|
Log in |
FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Thread question...
Is there a way to tell whether a procedure is being called from inside
a thread? Thanks, --Jon Grewer |
#2
|
|||
|
|||
Re: Thread question...
"Jon P. Grewer" <JonNoSpamThanks@Grewer.net> wrote in message news:mn.bace7d778a5c8992.76324@Grewer.net... > Is there a way to tell whether a procedure is being called from inside a > thread? Well, all code runs in threads, but assuming you want to distinguish between the main thread and some secondary thread, you should be able to do that with if GetCurrentThreadId <> MainThreadId then writeln('in secondary thread') else writeln('in main thread'); IHTH - Per |
#3
|
|||
|
|||
Re: Thread question...
Perfect! That is exactly what I needed. :-)
Thank you, --Jon Grewer Per Larsen [NDX] laid this down on his screen : > "Jon P. Grewer" <JonNoSpamThanks@Grewer.net> wrote in message > news:mn.bace7d778a5c8992.76324@Grewer.net... >> Is there a way to tell whether a procedure is being called from inside a >> thread? > > Well, all code runs in threads, but assuming you want to distinguish between > the main thread and some secondary thread, you should be able to do that with > > if GetCurrentThreadId <> MainThreadId then > writeln('in secondary thread') > else > writeln('in main thread'); > > IHTH > > - Per |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
For Hannes - Thread Post | Scott Martin | nexusdb.public.discussions | 18 | 14th March 2007 05:23 AM |
Thorsten, Thread example ... | Scott Martin | nexusdb.public.discussions | 4 | 30th June 2006 09:22 PM |
Background threads blocking the main thread | Dennis Esmonde-White | nexusdb.public.discussions | 3 | 12th June 2006 08:38 PM |
How to create a different session in diff thread: | Marc Pike | nexusdb.public.support.sql | 1 | 3rd August 2005 12:24 PM |
NexusDB Thread Example | William E. Mahaffey | nexusdb.public.discussions | 8 | 18th September 2003 12:54 PM |