Changeset 161


Ignore:
Timestamp:
Feb 7, 2011, 7:04:23 AM (13 years ago)
Author:
george
Message:
  • Added: Microthread context switching need to change exception stack as well. This need patch thread unit witch is part of system unit to make exception stack thread vars accesible.
Location:
MicroThreading
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • MicroThreading/Demo/Demo.lpi

    r160 r161  
    3939      </Item2>
    4040    </RequiredPackages>
    41     <Units Count="79">
     41    <Units Count="24">
    4242      <Unit0>
    4343        <Filename Value="Demo.lpr"/>
    4444        <IsPartOfProject Value="True"/>
    4545        <UnitName Value="Demo"/>
    46         <EditorIndex Value="17"/>
    4746        <WindowIndex Value="0"/>
    4847        <TopLine Value="1"/>
    49         <CursorPos X="34" Y="16"/>
    50         <UsageCount Value="92"/>
    51         <Loaded Value="True"/>
     48        <CursorPos X="1" Y="16"/>
     49        <UsageCount Value="270"/>
    5250      </Unit0>
    5351      <Unit1>
     
    5755        <ResourceBaseClass Value="Form"/>
    5856        <UnitName Value="UMainForm"/>
    59         <IsVisibleTab Value="True"/>
    60         <EditorIndex Value="9"/>
    61         <WindowIndex Value="0"/>
    62         <TopLine Value="345"/>
    63         <CursorPos X="29" Y="355"/>
    64         <UsageCount Value="92"/>
     57        <EditorIndex Value="1"/>
     58        <WindowIndex Value="0"/>
     59        <TopLine Value="369"/>
     60        <CursorPos X="1" Y="379"/>
     61        <UsageCount Value="270"/>
    6562        <Loaded Value="True"/>
    66         <LoadedDesigner Value="True"/>
    6763      </Unit1>
    6864      <Unit2>
    6965        <Filename Value="../UMicroThreading.pas"/>
    7066        <UnitName Value="UMicroThreading"/>
     67        <IsVisibleTab Value="True"/>
    7168        <EditorIndex Value="0"/>
    7269        <WindowIndex Value="0"/>
    73         <TopLine Value="544"/>
    74         <CursorPos X="1" Y="557"/>
    75         <UsageCount Value="47"/>
     70        <TopLine Value="500"/>
     71        <CursorPos X="1" Y="517"/>
     72        <UsageCount Value="136"/>
    7673        <Loaded Value="True"/>
    7774      </Unit2>
    7875      <Unit3>
    79         <Filename Value="../../../../lazarus/lcl/forms.pp"/>
    80         <UnitName Value="Forms"/>
    81         <WindowIndex Value="0"/>
    82         <TopLine Value="55"/>
    83         <CursorPos X="3" Y="70"/>
    84         <UsageCount Value="8"/>
     76        <Filename Value="../../ExceptionLogger/UExceptionLogger.pas"/>
     77        <UnitName Value="UExceptionLogger"/>
     78        <WindowIndex Value="0"/>
     79        <TopLine Value="1"/>
     80        <CursorPos X="27" Y="9"/>
     81        <UsageCount Value="19"/>
    8582      </Unit3>
    8683      <Unit4>
    87         <Filename Value="../../../../lazarus/lcl/include/application.inc"/>
    88         <WindowIndex Value="0"/>
    89         <TopLine Value="346"/>
    90         <CursorPos X="24" Y="351"/>
    91         <UsageCount Value="6"/>
     84        <Filename Value="../../ExceptionLogger/UStackTrace.pas"/>
     85        <UnitName Value="UStackTrace"/>
     86        <WindowIndex Value="0"/>
     87        <TopLine Value="1"/>
     88        <CursorPos X="12" Y="8"/>
     89        <UsageCount Value="26"/>
    9290      </Unit4>
    9391      <Unit5>
    94         <Filename Value="../../../../lazarus/lcl/interfaces/win32/issues.xml"/>
    95         <WindowIndex Value="0"/>
    96         <TopLine Value="1"/>
    97         <CursorPos X="1" Y="1"/>
    98         <UsageCount Value="6"/>
    99         <DefaultSyntaxHighlighter Value="XML"/>
     92        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/sysutils.pp"/>
     93        <UnitName Value="sysutils"/>
     94        <WindowIndex Value="0"/>
     95        <TopLine Value="1034"/>
     96        <CursorPos X="14" Y="1037"/>
     97        <UsageCount Value="21"/>
    10098      </Unit5>
    10199      <Unit6>
    102         <Filename Value="../../../../lazarus/lcl/xmlpropstorage.pas"/>
    103         <UnitName Value="XMLPropStorage"/>
    104         <WindowIndex Value="0"/>
    105         <TopLine Value="286"/>
    106         <CursorPos X="1" Y="1"/>
    107         <UsageCount Value="6"/>
     100        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/classes/classesh.inc"/>
     101        <WindowIndex Value="0"/>
     102        <TopLine Value="1638"/>
     103        <CursorPos X="28" Y="1645"/>
     104        <UsageCount Value="2"/>
    108105      </Unit6>
    109106      <Unit7>
    110         <Filename Value="../../ExceptionLogger/UExceptionLogger.pas"/>
    111         <UnitName Value="UExceptionLogger"/>
    112         <WindowIndex Value="0"/>
    113         <TopLine Value="1"/>
    114         <CursorPos X="1" Y="8"/>
    115         <UsageCount Value="8"/>
     107        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/wininc/func.inc"/>
     108        <WindowIndex Value="0"/>
     109        <TopLine Value="147"/>
     110        <CursorPos X="1" Y="158"/>
     111        <UsageCount Value="22"/>
    116112      </Unit7>
    117113      <Unit8>
    118         <Filename Value="../../ExceptionLogger/UStackTrace.pas"/>
    119         <UnitName Value="UStackTrace"/>
    120         <WindowIndex Value="0"/>
    121         <TopLine Value="56"/>
    122         <CursorPos X="24" Y="77"/>
    123         <UsageCount Value="17"/>
     114        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/sysutils/osutilsh.inc"/>
     115        <WindowIndex Value="0"/>
     116        <TopLine Value="14"/>
     117        <CursorPos X="11" Y="27"/>
     118        <UsageCount Value="23"/>
    124119      </Unit8>
    125120      <Unit9>
    126         <Filename Value="../../ExceptionLogger/CustomLineInfo.pas"/>
    127         <UnitName Value="CustomLineInfo"/>
    128         <WindowIndex Value="0"/>
    129         <TopLine Value="264"/>
    130         <CursorPos X="37" Y="141"/>
    131         <UsageCount Value="17"/>
     121        <Filename Value="../UPlatform.pas"/>
     122        <UnitName Value="UPlatform"/>
     123        <WindowIndex Value="0"/>
     124        <TopLine Value="23"/>
     125        <CursorPos X="31" Y="38"/>
     126        <UsageCount Value="37"/>
    132127      </Unit9>
    133128      <Unit10>
    134         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/exeinfo.pp"/>
    135         <UnitName Value="exeinfo"/>
    136         <WindowIndex Value="0"/>
    137         <TopLine Value="302"/>
    138         <CursorPos X="5" Y="33"/>
    139         <UsageCount Value="6"/>
    140       </Unit10>
    141       <Unit11>
    142         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/systemh.inc"/>
    143         <WindowIndex Value="0"/>
    144         <TopLine Value="469"/>
    145         <CursorPos X="3" Y="484"/>
    146         <UsageCount Value="12"/>
    147       </Unit11>
    148       <Unit12>
    149         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/i386/i386.inc"/>
    150         <WindowIndex Value="0"/>
    151         <TopLine Value="1046"/>
    152         <CursorPos X="34" Y="1053"/>
    153         <UsageCount Value="15"/>
    154       </Unit12>
    155       <Unit13>
    156         <Filename Value="../../../../lazarus/lcl/include/buttons.inc"/>
    157         <WindowIndex Value="0"/>
    158         <TopLine Value="317"/>
    159         <CursorPos X="1" Y="341"/>
    160         <UsageCount Value="8"/>
    161       </Unit13>
    162       <Unit14>
    163         <Filename Value="../../../../lazarus/lcl/include/buttoncontrol.inc"/>
    164         <WindowIndex Value="0"/>
    165         <TopLine Value="45"/>
    166         <CursorPos X="1" Y="62"/>
    167         <UsageCount Value="8"/>
    168       </Unit14>
    169       <Unit15>
    170         <Filename Value="../../../../lazarus/lcl/include/control.inc"/>
    171         <WindowIndex Value="0"/>
    172         <TopLine Value="1670"/>
    173         <CursorPos X="1" Y="1685"/>
    174         <UsageCount Value="9"/>
    175       </Unit15>
    176       <Unit16>
    177         <Filename Value="../Other/Coroutine.pas"/>
    178         <UnitName Value="Coroutine"/>
    179         <WindowIndex Value="0"/>
    180         <TopLine Value="290"/>
    181         <CursorPos X="36" Y="306"/>
    182         <UsageCount Value="18"/>
    183       </Unit16>
    184       <Unit17>
    185         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/heaph.inc"/>
    186         <WindowIndex Value="0"/>
    187         <TopLine Value="67"/>
    188         <CursorPos X="10" Y="91"/>
    189         <UsageCount Value="6"/>
    190       </Unit17>
    191       <Unit18>
    192         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/objpas/classes/classesh.inc"/>
    193         <WindowIndex Value="0"/>
    194         <TopLine Value="1"/>
    195         <CursorPos X="50" Y="9"/>
    196         <UsageCount Value="12"/>
    197       </Unit18>
    198       <Unit19>
    199         <Filename Value="../../../../lazarus/lcl/include/customform.inc"/>
    200         <WindowIndex Value="0"/>
    201         <TopLine Value="1348"/>
    202         <CursorPos X="1" Y="1363"/>
    203         <UsageCount Value="8"/>
    204       </Unit19>
    205       <Unit20>
    206         <Filename Value="../../../../lazarus/lcl/include/interfacebase.inc"/>
    207         <WindowIndex Value="0"/>
    208         <TopLine Value="32"/>
    209         <CursorPos X="48" Y="50"/>
    210         <UsageCount Value="7"/>
    211       </Unit20>
    212       <Unit21>
    213         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/objpas/sysutils/osutilsh.inc"/>
    214         <WindowIndex Value="0"/>
    215         <TopLine Value="8"/>
    216         <CursorPos X="11" Y="25"/>
    217         <UsageCount Value="9"/>
    218       </Unit21>
    219       <Unit22>
    220         <Filename Value="../MicroThreading.pas"/>
    221         <UnitName Value="MicroThreading"/>
    222         <WindowIndex Value="0"/>
    223         <TopLine Value="1"/>
    224         <CursorPos X="63" Y="10"/>
    225         <UsageCount Value="10"/>
    226       </Unit22>
    227       <Unit23>
    228         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/dateutil.inc"/>
    229         <WindowIndex Value="0"/>
    230         <TopLine Value="38"/>
    231         <CursorPos X="29" Y="50"/>
    232         <UsageCount Value="14"/>
    233       </Unit23>
    234       <Unit24>
    235         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/sysutils/datih.inc"/>
    236         <WindowIndex Value="0"/>
    237         <TopLine Value="106"/>
    238         <CursorPos X="10" Y="119"/>
    239         <UsageCount Value="17"/>
    240       </Unit24>
    241       <Unit25>
    242         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/sysutils/dati.inc"/>
    243         <WindowIndex Value="0"/>
    244         <TopLine Value="254"/>
    245         <CursorPos X="12" Y="258"/>
    246         <UsageCount Value="10"/>
    247       </Unit25>
    248       <Unit26>
    249         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/sysutils.pp"/>
    250         <UnitName Value="sysutils"/>
    251         <EditorIndex Value="14"/>
    252         <WindowIndex Value="0"/>
    253         <TopLine Value="1034"/>
    254         <CursorPos X="14" Y="1037"/>
    255         <UsageCount Value="11"/>
    256         <Loaded Value="True"/>
    257       </Unit26>
    258       <Unit27>
    259         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/wininc/redef.inc"/>
    260         <WindowIndex Value="0"/>
    261         <TopLine Value="739"/>
    262         <CursorPos X="27" Y="752"/>
    263         <UsageCount Value="17"/>
    264       </Unit27>
    265       <Unit28>
    266         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/packages/fcl-base/src/syncobjs.pp"/>
    267         <UnitName Value="syncobjs"/>
    268         <WindowIndex Value="0"/>
    269         <TopLine Value="104"/>
    270         <CursorPos X="28" Y="106"/>
    271         <UsageCount Value="14"/>
    272       </Unit28>
    273       <Unit29>
    274         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/inc/threadh.inc"/>
    275         <WindowIndex Value="0"/>
    276         <TopLine Value="138"/>
    277         <CursorPos X="11" Y="151"/>
    278         <UsageCount Value="14"/>
    279       </Unit29>
    280       <Unit30>
    281         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/inc/thread.inc"/>
    282         <WindowIndex Value="0"/>
    283         <TopLine Value="199"/>
    284         <CursorPos X="3" Y="202"/>
    285         <UsageCount Value="14"/>
    286       </Unit30>
    287       <Unit31>
    288         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/sysosh.inc"/>
    289         <WindowIndex Value="0"/>
    290         <TopLine Value="8"/>
    291         <CursorPos X="3" Y="33"/>
    292         <UsageCount Value="14"/>
    293       </Unit31>
    294       <Unit32>
    295         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/classes/classesh.inc"/>
    296         <WindowIndex Value="0"/>
    297         <TopLine Value="1638"/>
    298         <CursorPos X="28" Y="1645"/>
    299         <UsageCount Value="20"/>
    300       </Unit32>
    301       <Unit33>
    302         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/tthread.inc"/>
    303         <WindowIndex Value="0"/>
    304         <TopLine Value="52"/>
    305         <CursorPos X="25" Y="65"/>
    306         <UsageCount Value="14"/>
    307       </Unit33>
    308       <Unit34>
    309         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/wininc/func.inc"/>
    310         <EditorIndex Value="15"/>
    311         <WindowIndex Value="0"/>
    312         <TopLine Value="147"/>
    313         <CursorPos X="1" Y="158"/>
    314         <UsageCount Value="12"/>
    315         <Loaded Value="True"/>
    316       </Unit34>
    317       <Unit35>
    318         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/wininc/defines.inc"/>
    319         <WindowIndex Value="0"/>
    320         <TopLine Value="1923"/>
    321         <CursorPos X="6" Y="1936"/>
    322         <UsageCount Value="11"/>
    323       </Unit35>
    324       <Unit36>
    325         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/classes/classes.inc"/>
    326         <WindowIndex Value="0"/>
    327         <TopLine Value="124"/>
    328         <CursorPos X="3" Y="126"/>
    329         <UsageCount Value="17"/>
    330       </Unit36>
    331       <Unit37>
    332         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/inc/objpash.inc"/>
    333         <WindowIndex Value="0"/>
    334         <TopLine Value="181"/>
    335         <CursorPos X="21" Y="194"/>
    336         <UsageCount Value="11"/>
    337       </Unit37>
    338       <Unit38>
    339         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/sysutils/osutilsh.inc"/>
    340         <EditorIndex Value="13"/>
    341         <WindowIndex Value="0"/>
    342         <TopLine Value="14"/>
    343         <CursorPos X="11" Y="27"/>
    344         <UsageCount Value="13"/>
    345         <Loaded Value="True"/>
    346       </Unit38>
    347       <Unit39>
    348         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/include/control.inc"/>
    349         <WindowIndex Value="0"/>
    350         <TopLine Value="2275"/>
    351         <CursorPos X="39" Y="2285"/>
    352         <UsageCount Value="10"/>
    353       </Unit39>
    354       <Unit40>
    355         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/inc/systemh.inc"/>
    356         <WindowIndex Value="0"/>
    357         <TopLine Value="480"/>
    358         <CursorPos X="3" Y="493"/>
    359         <UsageCount Value="9"/>
    360       </Unit40>
    361       <Unit41>
    362         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/syswin.inc"/>
    363         <WindowIndex Value="0"/>
    364         <TopLine Value="197"/>
    365         <CursorPos X="30" Y="208"/>
    366         <UsageCount Value="8"/>
    367       </Unit41>
    368       <Unit42>
    369         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/inc/system.inc"/>
    370         <WindowIndex Value="0"/>
    371         <TopLine Value="737"/>
    372         <CursorPos X="21" Y="747"/>
    373         <UsageCount Value="8"/>
    374       </Unit42>
    375       <Unit43>
    376         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/inc/innr.inc"/>
    377         <WindowIndex Value="0"/>
    378         <TopLine Value="96"/>
    379         <CursorPos X="1" Y="1"/>
    380         <UsageCount Value="8"/>
    381       </Unit43>
    382       <Unit44>
    383         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/include/spinedit.inc"/>
    384         <WindowIndex Value="0"/>
    385         <TopLine Value="221"/>
    386         <CursorPos X="1" Y="235"/>
    387         <UsageCount Value="11"/>
    388       </Unit44>
    389       <Unit45>
    390         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/interfaces/win32/win32object.inc"/>
    391         <WindowIndex Value="0"/>
    392         <TopLine Value="387"/>
    393         <CursorPos X="1" Y="400"/>
    394         <UsageCount Value="11"/>
    395       </Unit45>
    396       <Unit46>
    397         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/wininc/struct.inc"/>
    398         <WindowIndex Value="0"/>
    399         <TopLine Value="6081"/>
    400         <CursorPos X="6" Y="6094"/>
    401         <UsageCount Value="11"/>
    402       </Unit46>
    403       <Unit47>
    404         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/inc/objpas.inc"/>
    405         <WindowIndex Value="0"/>
    406         <TopLine Value="160"/>
    407         <CursorPos X="12" Y="163"/>
    408         <UsageCount Value="8"/>
    409       </Unit47>
    410       <Unit48>
    411         <Filename Value="../UPlatform.pas"/>
    412         <UnitName Value="UPlatform"/>
    413         <EditorIndex Value="8"/>
    414         <WindowIndex Value="0"/>
    415         <TopLine Value="23"/>
    416         <CursorPos X="31" Y="38"/>
    417         <UsageCount Value="27"/>
    418         <Loaded Value="True"/>
    419       </Unit48>
    420       <Unit49>
    421         <Filename Value="../../../../lazarus/lcl/interfaces/gtk2/gtk2winapi.inc"/>
    422         <WindowIndex Value="0"/>
    423         <TopLine Value="9153"/>
    424         <CursorPos X="8" Y="9166"/>
    425         <UsageCount Value="8"/>
    426       </Unit49>
    427       <Unit50>
    428         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/unix/sysutils.pp"/>
    429         <UnitName Value="sysutils"/>
    430         <WindowIndex Value="0"/>
    431         <TopLine Value="1"/>
    432         <CursorPos X="1" Y="1"/>
    433         <UsageCount Value="8"/>
    434       </Unit50>
    435       <Unit51>
    436         <Filename Value="../../../../lazarus/lcl/interfaces/gtk2/gtk2widgetset.inc"/>
    437         <WindowIndex Value="0"/>
    438         <TopLine Value="2380"/>
    439         <CursorPos X="30" Y="2390"/>
    440         <UsageCount Value="8"/>
    441       </Unit51>
    442       <Unit52>
    443         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/objpas/classes/classes.inc"/>
    444         <WindowIndex Value="0"/>
    445         <TopLine Value="150"/>
    446         <CursorPos X="55" Y="162"/>
    447         <UsageCount Value="8"/>
    448       </Unit52>
    449       <Unit53>
    450         <Filename Value="../../../../lazarus/lcl/include/wincontrol.inc"/>
    451         <WindowIndex Value="0"/>
    452         <TopLine Value="5227"/>
    453         <CursorPos X="1" Y="5242"/>
    454         <UsageCount Value="8"/>
    455       </Unit53>
    456       <Unit54>
    457         <Filename Value="../../../../lazarus/lcl/lclmessageglue.pas"/>
    458         <UnitName Value="LCLMessageGlue"/>
    459         <WindowIndex Value="0"/>
    460         <TopLine Value="102"/>
    461         <CursorPos X="1" Y="121"/>
    462         <UsageCount Value="8"/>
    463       </Unit54>
    464       <Unit55>
    465         <Filename Value="../../../../lazarus/lcl/interfaces/gtk2/gtk2proc.inc"/>
    466         <WindowIndex Value="0"/>
    467         <TopLine Value="3515"/>
    468         <CursorPos X="1" Y="3531"/>
    469         <UsageCount Value="8"/>
    470       </Unit55>
    471       <Unit56>
    472         <Filename Value="../../../../lazarus/lcl/interfaces/gtk2/gtk2callback.inc"/>
    473         <WindowIndex Value="0"/>
    474         <TopLine Value="1159"/>
    475         <CursorPos X="1" Y="1174"/>
    476         <UsageCount Value="8"/>
    477       </Unit56>
    478       <Unit57>
    479         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/classes/lists.inc"/>
    480         <WindowIndex Value="0"/>
    481         <TopLine Value="909"/>
    482         <CursorPos X="26" Y="917"/>
    483         <UsageCount Value="15"/>
    484       </Unit57>
    485       <Unit58>
    486         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/interfaces/win32/win32callback.inc"/>
    487         <WindowIndex Value="0"/>
    488         <TopLine Value="1086"/>
    489         <CursorPos X="1" Y="1099"/>
    490         <UsageCount Value="12"/>
    491       </Unit58>
    492       <Unit59>
    493         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/extctrls.pp"/>
    494         <UnitName Value="ExtCtrls"/>
    495         <WindowIndex Value="0"/>
    496         <TopLine Value="357"/>
    497         <CursorPos X="3" Y="370"/>
    498         <UsageCount Value="10"/>
    499       </Unit59>
    500       <Unit60>
    501         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/customtimer.pas"/>
    502         <UnitName Value="CustomTimer"/>
    503         <WindowIndex Value="0"/>
    504         <TopLine Value="40"/>
    505         <CursorPos X="17" Y="53"/>
    506         <UsageCount Value="11"/>
    507       </Unit60>
    508       <Unit61>
    509         <Filename Value="../ReadMe.txt"/>
    510         <WindowIndex Value="0"/>
    511         <TopLine Value="1"/>
    512         <CursorPos X="17" Y="14"/>
    513         <UsageCount Value="10"/>
    514         <DefaultSyntaxHighlighter Value="None"/>
    515       </Unit61>
    516       <Unit62>
    517         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/forms.pp"/>
    518         <UnitName Value="Forms"/>
    519         <WindowIndex Value="0"/>
    520         <TopLine Value="1688"/>
    521         <CursorPos X="1" Y="1701"/>
    522         <UsageCount Value="10"/>
    523       </Unit62>
    524       <Unit63>
    525         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/sysutils/sysutilh.inc"/>
    526         <WindowIndex Value="0"/>
    527         <TopLine Value="1"/>
    528         <CursorPos X="55" Y="4"/>
    529         <UsageCount Value="16"/>
    530       </Unit63>
    531       <Unit64>
    532         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/controls.pp"/>
    533         <UnitName Value="Controls"/>
    534         <WindowIndex Value="0"/>
    535         <TopLine Value="2660"/>
    536         <CursorPos X="1" Y="2673"/>
    537         <UsageCount Value="15"/>
    538       </Unit64>
    539       <Unit65>
    540         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/system.inc"/>
    541         <WindowIndex Value="0"/>
    542         <TopLine Value="671"/>
    543         <CursorPos X="1" Y="673"/>
    544         <UsageCount Value="11"/>
    545       </Unit65>
    546       <Unit66>
    547         <Filename Value="/usr/share/fpcsrc/2.4.0/rtl/inc/objpash.inc"/>
    548         <WindowIndex Value="0"/>
    549         <TopLine Value="160"/>
    550         <CursorPos X="23" Y="175"/>
    551         <UsageCount Value="11"/>
    552       </Unit66>
    553       <Unit67>
    554129        <Filename Value="../UMicroThreadList.pas"/>
    555130        <ComponentName Value="MicroThreadListForm"/>
    556131        <ResourceBaseClass Value="Form"/>
    557132        <UnitName Value="UMicroThreadList"/>
    558         <EditorIndex Value="16"/>
    559133        <WindowIndex Value="0"/>
    560134        <TopLine Value="1"/>
    561135        <CursorPos X="44" Y="17"/>
    562         <UsageCount Value="11"/>
    563         <Loaded Value="True"/>
    564         <LoadedDesigner Value="True"/>
    565       </Unit67>
    566       <Unit68>
    567         <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/include/customform.inc"/>
    568         <WindowIndex Value="0"/>
    569         <TopLine Value="2100"/>
    570         <CursorPos X="1" Y="2113"/>
    571         <UsageCount Value="10"/>
    572       </Unit68>
    573       <Unit69>
     136        <UsageCount Value="21"/>
     137      </Unit10>
     138      <Unit11>
    574139        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/objpas/sysutils/sysutilh.inc"/>
    575         <EditorIndex Value="12"/>
    576         <WindowIndex Value="0"/>
    577         <TopLine Value="100"/>
    578         <CursorPos X="16" Y="119"/>
    579         <UsageCount Value="11"/>
    580         <Loaded Value="True"/>
    581       </Unit69>
    582       <Unit70>
     140        <WindowIndex Value="0"/>
     141        <TopLine Value="191"/>
     142        <CursorPos X="13" Y="204"/>
     143        <UsageCount Value="21"/>
     144      </Unit11>
     145      <Unit12>
    583146        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/lcl/interfaces/win32/win32object.inc"/>
    584         <EditorIndex Value="7"/>
    585147        <WindowIndex Value="0"/>
    586148        <TopLine Value="600"/>
    587149        <CursorPos X="1" Y="613"/>
    588         <UsageCount Value="10"/>
    589         <Loaded Value="True"/>
    590       </Unit70>
    591       <Unit71>
     150        <UsageCount Value="20"/>
     151      </Unit12>
     152      <Unit13>
    592153        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/objpas/classes/classesh.inc"/>
    593         <EditorIndex Value="10"/>
    594154        <WindowIndex Value="0"/>
    595155        <TopLine Value="1483"/>
    596156        <CursorPos X="51" Y="1490"/>
    597         <UsageCount Value="10"/>
    598         <Loaded Value="True"/>
    599       </Unit71>
    600       <Unit72>
     157        <UsageCount Value="20"/>
     158      </Unit13>
     159      <Unit14>
    601160        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/win/tthread.inc"/>
    602         <EditorIndex Value="11"/>
    603161        <WindowIndex Value="0"/>
    604162        <TopLine Value="30"/>
    605163        <CursorPos X="3" Y="15"/>
    606         <UsageCount Value="10"/>
    607         <Loaded Value="True"/>
    608       </Unit72>
    609       <Unit73>
     164        <UsageCount Value="20"/>
     165      </Unit14>
     166      <Unit15>
    610167        <Filename Value="../UThreadEx.pas"/>
    611168        <UnitName Value="UThreadEx"/>
    612         <EditorIndex Value="1"/>
    613169        <WindowIndex Value="0"/>
    614170        <TopLine Value="1"/>
    615171        <CursorPos X="20" Y="1"/>
    616         <UsageCount Value="20"/>
    617         <Loaded Value="True"/>
    618       </Unit73>
    619       <Unit74>
     172        <UsageCount Value="30"/>
     173      </Unit15>
     174      <Unit16>
    620175        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/inc/systemh.inc"/>
    621         <EditorIndex Value="5"/>
    622         <WindowIndex Value="0"/>
    623         <TopLine Value="982"/>
    624         <CursorPos X="10" Y="995"/>
    625         <UsageCount Value="10"/>
    626         <Loaded Value="True"/>
    627       </Unit74>
    628       <Unit75>
     176        <WindowIndex Value="0"/>
     177        <TopLine Value="469"/>
     178        <CursorPos X="18" Y="484"/>
     179        <UsageCount Value="20"/>
     180      </Unit16>
     181      <Unit17>
    629182        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/inc/system.inc"/>
    630         <EditorIndex Value="6"/>
    631         <WindowIndex Value="0"/>
    632         <TopLine Value="692"/>
    633         <CursorPos X="1" Y="694"/>
    634         <UsageCount Value="10"/>
    635         <Loaded Value="True"/>
    636       </Unit75>
    637       <Unit76>
     183        <WindowIndex Value="0"/>
     184        <TopLine Value="920"/>
     185        <CursorPos X="17" Y="942"/>
     186        <UsageCount Value="20"/>
     187      </Unit17>
     188      <Unit18>
    638189        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/objpas/sysutils/osutilsh.inc"/>
    639         <EditorIndex Value="4"/>
    640190        <WindowIndex Value="0"/>
    641191        <TopLine Value="14"/>
    642192        <CursorPos X="11" Y="27"/>
    643         <UsageCount Value="10"/>
    644         <Loaded Value="True"/>
    645       </Unit76>
    646       <Unit77>
     193        <UsageCount Value="20"/>
     194      </Unit18>
     195      <Unit19>
    647196        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/inc/threadh.inc"/>
    648         <EditorIndex Value="2"/>
    649197        <WindowIndex Value="0"/>
    650198        <TopLine Value="57"/>
    651199        <CursorPos X="5" Y="70"/>
    652         <UsageCount Value="10"/>
    653         <Loaded Value="True"/>
    654       </Unit77>
    655       <Unit78>
     200        <UsageCount Value="20"/>
     201      </Unit19>
     202      <Unit20>
    656203        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/inc/thread.inc"/>
    657         <EditorIndex Value="3"/>
    658204        <WindowIndex Value="0"/>
    659205        <TopLine Value="169"/>
    660206        <CursorPos X="33" Y="184"/>
    661         <UsageCount Value="10"/>
    662         <Loaded Value="True"/>
    663       </Unit78>
     207        <UsageCount Value="20"/>
     208      </Unit20>
     209      <Unit21>
     210        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/objpas/sysutils/sysutils.inc"/>
     211        <WindowIndex Value="0"/>
     212        <TopLine Value="429"/>
     213        <CursorPos X="19" Y="435"/>
     214        <UsageCount Value="19"/>
     215      </Unit21>
     216      <Unit22>
     217        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/inc/objpash.inc"/>
     218        <WindowIndex Value="0"/>
     219        <TopLine Value="329"/>
     220        <CursorPos X="14" Y="342"/>
     221        <UsageCount Value="19"/>
     222      </Unit22>
     223      <Unit23>
     224        <Filename Value="../../../../Programy/Lazarus/0.9.31_2.5.1/fpc/2.5.1/source/rtl/inc/except.inc"/>
     225        <WindowIndex Value="0"/>
     226        <TopLine Value="29"/>
     227        <CursorPos X="23" Y="42"/>
     228        <UsageCount Value="16"/>
     229      </Unit23>
    664230    </Units>
    665231    <JumpHistory Count="30" HistoryIndex="29">
    666232      <Position1>
    667         <Filename Value="UMainForm.pas"/>
    668         <Caret Line="355" Column="1" TopLine="339"/>
     233        <Filename Value="../UMicroThreading.pas"/>
     234        <Caret Line="462" Column="1" TopLine="451"/>
    669235      </Position1>
    670236      <Position2>
    671         <Filename Value="../UThreadEx.pas"/>
    672         <Caret Line="37" Column="1" TopLine="24"/>
     237        <Filename Value="../UMicroThreading.pas"/>
     238        <Caret Line="463" Column="1" TopLine="451"/>
    673239      </Position2>
    674240      <Position3>
    675         <Filename Value="../UThreadEx.pas"/>
    676         <Caret Line="38" Column="1" TopLine="24"/>
     241        <Filename Value="../UMicroThreading.pas"/>
     242        <Caret Line="434" Column="1" TopLine="423"/>
    677243      </Position3>
    678244      <Position4>
    679         <Filename Value="../UThreadEx.pas"/>
    680         <Caret Line="39" Column="1" TopLine="24"/>
     245        <Filename Value="../UMicroThreading.pas"/>
     246        <Caret Line="462" Column="1" TopLine="451"/>
    681247      </Position4>
    682248      <Position5>
    683         <Filename Value="../UThreadEx.pas"/>
    684         <Caret Line="41" Column="1" TopLine="24"/>
     249        <Filename Value="../UMicroThreading.pas"/>
     250        <Caret Line="463" Column="1" TopLine="451"/>
    685251      </Position5>
    686252      <Position6>
    687         <Filename Value="../UThreadEx.pas"/>
    688         <Caret Line="42" Column="1" TopLine="24"/>
     253        <Filename Value="../UMicroThreading.pas"/>
     254        <Caret Line="545" Column="1" TopLine="534"/>
    689255      </Position6>
    690256      <Position7>
    691         <Filename Value="../UThreadEx.pas"/>
    692         <Caret Line="44" Column="1" TopLine="24"/>
     257        <Filename Value="../UMicroThreading.pas"/>
     258        <Caret Line="429" Column="1" TopLine="418"/>
    693259      </Position7>
    694260      <Position8>
    695         <Filename Value="../UThreadEx.pas"/>
    696         <Caret Line="45" Column="1" TopLine="24"/>
     261        <Filename Value="../UMicroThreading.pas"/>
     262        <Caret Line="430" Column="1" TopLine="418"/>
    697263      </Position8>
    698264      <Position9>
    699265        <Filename Value="../UMicroThreading.pas"/>
    700         <Caret Line="130" Column="17" TopLine="117"/>
     266        <Caret Line="574" Column="1" TopLine="563"/>
    701267      </Position9>
    702268      <Position10>
    703         <Filename Value="UMainForm.pas"/>
    704         <Caret Line="378" Column="1" TopLine="365"/>
     269        <Filename Value="../UMicroThreading.pas"/>
     270        <Caret Line="575" Column="1" TopLine="563"/>
    705271      </Position10>
    706272      <Position11>
    707273        <Filename Value="../UMicroThreading.pas"/>
    708         <Caret Line="552" Column="1" TopLine="539"/>
     274        <Caret Line="576" Column="1" TopLine="563"/>
    709275      </Position11>
    710276      <Position12>
    711         <Filename Value="UMainForm.pas"/>
    712         <Caret Line="352" Column="1" TopLine="339"/>
     277        <Filename Value="../UMicroThreading.pas"/>
     278        <Caret Line="572" Column="1" TopLine="563"/>
    713279      </Position12>
    714280      <Position13>
    715         <Filename Value="UMainForm.pas"/>
    716         <Caret Line="353" Column="1" TopLine="339"/>
     281        <Filename Value="../UMicroThreading.pas"/>
     282        <Caret Line="573" Column="1" TopLine="563"/>
    717283      </Position13>
    718284      <Position14>
    719         <Filename Value="UMainForm.pas"/>
    720         <Caret Line="354" Column="1" TopLine="339"/>
     285        <Filename Value="../UMicroThreading.pas"/>
     286        <Caret Line="434" Column="1" TopLine="423"/>
    721287      </Position14>
    722288      <Position15>
    723         <Filename Value="UMainForm.pas"/>
    724         <Caret Line="355" Column="1" TopLine="339"/>
     289        <Filename Value="../UMicroThreading.pas"/>
     290        <Caret Line="462" Column="1" TopLine="451"/>
    725291      </Position15>
    726292      <Position16>
    727         <Filename Value="../UThreadEx.pas"/>
    728         <Caret Line="37" Column="1" TopLine="27"/>
     293        <Filename Value="../UMicroThreading.pas"/>
     294        <Caret Line="463" Column="1" TopLine="451"/>
    729295      </Position16>
    730296      <Position17>
    731         <Filename Value="../UThreadEx.pas"/>
    732         <Caret Line="38" Column="1" TopLine="27"/>
     297        <Filename Value="../UMicroThreading.pas"/>
     298        <Caret Line="545" Column="30" TopLine="534"/>
    733299      </Position17>
    734300      <Position18>
    735         <Filename Value="../UThreadEx.pas"/>
    736         <Caret Line="39" Column="1" TopLine="27"/>
     301        <Filename Value="../UMicroThreading.pas"/>
     302        <Caret Line="429" Column="1" TopLine="418"/>
    737303      </Position18>
    738304      <Position19>
    739         <Filename Value="../UThreadEx.pas"/>
    740         <Caret Line="41" Column="1" TopLine="27"/>
     305        <Filename Value="../UMicroThreading.pas"/>
     306        <Caret Line="430" Column="1" TopLine="418"/>
    741307      </Position19>
    742308      <Position20>
    743         <Filename Value="../UThreadEx.pas"/>
    744         <Caret Line="42" Column="1" TopLine="27"/>
     309        <Filename Value="../UMicroThreading.pas"/>
     310        <Caret Line="574" Column="1" TopLine="563"/>
    745311      </Position20>
    746312      <Position21>
    747         <Filename Value="../UThreadEx.pas"/>
    748         <Caret Line="44" Column="1" TopLine="27"/>
     313        <Filename Value="../UMicroThreading.pas"/>
     314        <Caret Line="575" Column="1" TopLine="563"/>
    749315      </Position21>
    750316      <Position22>
    751         <Filename Value="../UThreadEx.pas"/>
    752         <Caret Line="1" Column="20" TopLine="1"/>
     317        <Filename Value="../UMicroThreading.pas"/>
     318        <Caret Line="513" Column="34" TopLine="504"/>
    753319      </Position22>
    754320      <Position23>
    755321        <Filename Value="../UMicroThreading.pas"/>
    756         <Caret Line="619" Column="24" TopLine="607"/>
     322        <Caret Line="517" Column="1" TopLine="504"/>
    757323      </Position23>
    758324      <Position24>
    759325        <Filename Value="../UMicroThreading.pas"/>
    760         <Caret Line="29" Column="33" TopLine="13"/>
     326        <Caret Line="545" Column="1" TopLine="534"/>
    761327      </Position24>
    762328      <Position25>
    763329        <Filename Value="UMainForm.pas"/>
    764         <Caret Line="378" Column="1" TopLine="365"/>
     330        <Caret Line="379" Column="1" TopLine="369"/>
    765331      </Position25>
    766332      <Position26>
    767333        <Filename Value="../UMicroThreading.pas"/>
    768         <Caret Line="557" Column="1" TopLine="544"/>
     334        <Caret Line="613" Column="1" TopLine="602"/>
    769335      </Position26>
    770336      <Position27>
    771         <Filename Value="UMainForm.pas"/>
    772         <Caret Line="352" Column="1" TopLine="339"/>
     337        <Filename Value="../UMicroThreading.pas"/>
     338        <Caret Line="428" Column="6" TopLine="417"/>
    773339      </Position27>
    774340      <Position28>
    775         <Filename Value="UMainForm.pas"/>
    776         <Caret Line="353" Column="1" TopLine="339"/>
     341        <Filename Value="../UMicroThreading.pas"/>
     342        <Caret Line="434" Column="3" TopLine="504"/>
    777343      </Position28>
    778344      <Position29>
    779         <Filename Value="UMainForm.pas"/>
    780         <Caret Line="354" Column="1" TopLine="339"/>
     345        <Filename Value="../UMicroThreading.pas"/>
     346        <Caret Line="579" Column="1" TopLine="568"/>
    781347      </Position29>
    782348      <Position30>
    783         <Filename Value="UMainForm.pas"/>
    784         <Caret Line="355" Column="1" TopLine="339"/>
     349        <Filename Value="../UMicroThreading.pas"/>
     350        <Caret Line="435" Column="1" TopLine="424"/>
    785351      </Position30>
    786352    </JumpHistory>
    787353  </ProjectOptions>
    788354  <CompilerOptions>
    789     <Version Value="9"/>
     355    <Version Value="10"/>
    790356    <Target>
    791357      <Filename Value="Demo"/>
     
    823389  </CompilerOptions>
    824390  <Debugging>
    825     <BreakPoints Count="7">
     391    <BreakPoints Count="2">
    826392      <Item1>
    827393        <Source Value="../UMicroThreading.pas"/>
    828         <Line Value="253"/>
     394        <Line Value="261"/>
    829395      </Item1>
    830396      <Item2>
     
    832398        <Line Value="1036"/>
    833399      </Item2>
    834       <Item3>
    835         <Source Value="../UMicroThreading.pas"/>
    836         <Line Value="591"/>
    837       </Item3>
    838       <Item4>
    839         <Source Value="../UMicroThreading.pas"/>
    840         <Line Value="590"/>
    841       </Item4>
    842       <Item5>
    843         <Source Value="UMainForm.pas"/>
    844         <Line Value="378"/>
    845       </Item5>
    846       <Item6>
    847         <Source Value="../UMicroThreading.pas"/>
    848         <Line Value="557"/>
    849       </Item6>
    850       <Item7>
    851         <Source Value="UMainForm.pas"/>
    852         <Line Value="355"/>
    853       </Item7>
    854400    </BreakPoints>
    855401    <Watches Count="2">
  • MicroThreading/Demo/UMainForm.pas

    r160 r161  
    369369begin
    370370  for I := 0 to MainForm.Iterations - 1 do begin
     371    try
    371372    Q := 0;
    372373    while Q < 100 do Inc(Q);
     
    381382    Completion := I / MainForm.Iterations;
    382383    Yield;
     384
     385    except
     386      Q := 0;
     387      raise  Exception.Create('Exception from microthread');
     388    end;
    383389  end;
    384390end;
  • MicroThreading/UMicroThreading.pas

    r160 r161  
    2828  SNilThreadReference = 'Can''t release nil thread.';
    2929  SManagerMicroThreadRunning = 'Manager already have running microthread';
     30  SManagerReferenceLost = 'Reference to manager lost';
     31  SCantDetermineThreadID = 'Can''t determine thread for id %d';
     32  SNotInThread = 'Not in thread';
     33
    3034
    3135type
     
    6973    FStackSize: Integer;
    7074    FBasePointer: Pointer;
     75    FExceptObjectStack: PExceptObject;
     76    FExceptAddrStack: PExceptAddr;
    7177    FExecuted: Boolean; // At first go through Execute method, then switch context
    7278    FBlockState: TMicroThreadBlockState;
     
    146152    FStackPointer: Pointer;
    147153    FBasePointer: Pointer;
     154    FExceptObjectStack: PExceptObject;
     155    FExceptAddrStack: PExceptAddr;
    148156    FExecuteCount: Integer;
    149157    FExecutedCount: Integer;
     
    302310    Thread := TThreadEx.CurrentThread;
    303311    if Assigned(Thread) then TThread.Synchronize(Thread, Method)
    304       else raise Exception.Create('Can''t determine thread for id ' + IntToStr(GetCurrentThreadId));
     312      else raise Exception.Create(Format(SCantDetermineThreadID, [GetCurrentThreadId]));
    305313  end else Method;
    306314end;
     
    312320  MT := GetCurrentMicroThread;
    313321  if Assigned(MT) then Result := MT.WaitForEvent(Event, Duration)
    314     else raise Exception.Create('Not in thread');
     322    else raise Exception.Create(SNotInThread);
    315323//    else Result := Event.WaitFor(Trunc(Duration / OneMillisecond));
    316324end;
     
    428436    FCurrentMicroThread.FExecutionTime := FCurrentMicroThread.FExecutionTime +
    429437      (FCurrentMicroThread.FExecutionEndTime - FCurrentMicroThread.FExecutionStartTime);
     438
     439    FCurrentMicroThread.FExceptObjectStack := GetExceptionObjectStack;
     440    FCurrentMicroThread.FExceptAddrStack := GetExceptionAddrStack;
    430441    asm
    431442      // Store microthread stack
     
    443454      mov ebp, ebx
    444455    end;
     456    SetExceptionObjectStack(FExceptObjectStack);
     457    SetExceptionAddrStack(FExceptAddrStack);
    445458    FCurrentMicroThread.CheckStack;
    446459    FScheduler.ReleaseMicroThread(FCurrentMicroThread);
     
    452465      Inc(FExecutedCount);
    453466      FCurrentMicroThread.FExecutionStartTime := NowPrecise;
     467      FExceptObjectStack := GetExceptionObjectStack;
     468      FExceptAddrStack := GetExceptionAddrStack;
    454469      asm
    455470        // Store manager stack
     
    463478        // First time micro thread execution
    464479        FCurrentMicroThread.FExecuted := True;
     480        SetExceptionObjectStack(FCurrentMicroThread.FExceptObjectStack);
     481        SetExceptionAddrStack(FCurrentMicroThread.FExceptAddrStack);
    465482        asm
    466483          // Restore microthread stack
     
    484501          mov ebp, ebx
    485502        end;
     503        SetExceptionObjectStack(FExceptObjectStack);
     504        SetExceptionAddrStack(FExceptAddrStack);
    486505        FCurrentMicroThread.CheckStack;
    487506        FCurrentMicroThread.FExecutionEndTime := NowPrecise;
    488507        FCurrentMicroThread.FExecutionTime := FCurrentMicroThread.FExecutionTime +
    489          (FCurrentMicroThread.FExecutionEndTime - FCurrentMicroThread.FExecutionStartTime);
     508        (FCurrentMicroThread.FExecutionEndTime - FCurrentMicroThread.FExecutionStartTime);
    490509        FCurrentMicroThread.FStatePending := tsBlocked;
    491510        FCurrentMicroThread.FBlockState := tbsTerminated;
     
    496515            FMicroThreadsLock.Acquire;
    497516            FMicroThreads.Delete(FMicroThreads.IndexOf(FCurrentMicroThread));
     517            FCurrentMicroThread.Manager := nil;
    498518          finally
    499519            FMicroThreadsLock.Release;
     
    509529        // Regular selected microthread execution
    510530        FCurrentMicroThread.CheckStack;
     531        SetExceptionObjectStack(FCurrentMicroThread.FExceptObjectStack);
     532        SetExceptionAddrStack(FCurrentMicroThread.FExceptAddrStack);
    511533        asm
    512534          // Restore microthread stack
     
    635657begin
    636658  if not Assigned(FManager) then
    637     raise Exception.Create('Manager reference lost');
     659    raise Exception.Create(SManagerReferenceLost);
    638660  if FStatePending = tsNone then
    639661    FStatePending := tsWaiting;
     
    879901  Executed: Integer;
    880902begin
    881   Executed := FMainThreadManager.Execute(1);
    882   if Executed = 0 then Sleep(1);
    883   // If not terminated then queue next tick else terminate
    884   if (FState = ssRunning) and FUseMainThread then
    885     Application.QueueAsyncCall(MainThreadTick, 0)
    886     else FMainThreadTerminated := True;
     903//  try
     904    Executed := FMainThreadManager.Execute(1);
     905    if Executed = 0 then Sleep(1);
     906    // If not terminated then queue next tick else terminate
     907    if (FState = ssRunning) and FUseMainThread then
     908      Application.QueueAsyncCall(MainThreadTick, 0)
     909      else FMainThreadTerminated := True;
     910//  except
     911//    FMainThreadTerminated := True;
     912//    raise;
     913//  end;
    887914end;
    888915
Note: See TracChangeset for help on using the changeset viewer.