diff options
author | eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-11-08 18:51:40 +0000 |
---|---|---|
committer | eddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-11-08 18:51:40 +0000 |
commit | 6ca1db26350a589b5bcb3e2eac35a7965d5ab448 (patch) | |
tree | 37f4d6bef02b3bbeccefbaafa5eeb94a3942a7f8 /Game/Code/MacOSX/Wrapper/PseudoThread.pas | |
parent | a5ca459937cf9f08d47ca6aca16e777153821f25 (diff) | |
download | usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.tar.gz usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.tar.xz usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.zip |
Mac OS X: Added PseudoThread for debugging, because debugging of threaded code causes problems with Xcode and FreePascal.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@594 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/MacOSX/Wrapper/PseudoThread.pas')
-rwxr-xr-x | Game/Code/MacOSX/Wrapper/PseudoThread.pas | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Game/Code/MacOSX/Wrapper/PseudoThread.pas b/Game/Code/MacOSX/Wrapper/PseudoThread.pas new file mode 100755 index 00000000..d81a5cfe --- /dev/null +++ b/Game/Code/MacOSX/Wrapper/PseudoThread.pas @@ -0,0 +1,48 @@ +unit PseudoThread; + +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + +{$I switches.inc} + +interface + +type + + // Debugging threads with XCode doesn't seem to work. + // We use PseudoThread in Debug mode to get proper debugging. + TPseudoThread = class(TObject) + private + protected + Terminated, + FreeOnTerminate : Boolean; + procedure Execute; virtual; abstract; + procedure Resume; + procedure Suspend; + public + constructor Create(const suspended : Boolean); + end; + +implementation + +{ TPseudoThread } + +constructor TPseudoThread.Create(const suspended : Boolean); +begin + if not suspended then begin + Execute; + end; +end; + +procedure TPseudoThread.Resume; +begin + Execute; +end; + +procedure TPseudoThread.Suspend; +begin +end; + +end. + |