public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* isCurrentThread()
@ 2021-04-03  8:16 Markus Forrer
  2021-04-03 22:15 ` isCurrentThread() ross.johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Forrer @ 2021-04-03  8:16 UTC (permalink / raw)
  To: pthreads-win32

I have implemented a method in my thread class Win32Thread to find out if it is the current thread:

bool Win32Thread::isCurrentThread() const
{
    pthread_t currentThread = pthread_self();

    return pthread_equal(currentThread, mThread) != 0;
}


Unfortunately, this implementation does not work. The function pthread_self() gets the current win32 threadId with GetCurrentThreadId(). But how do I have to check in my method isCurrentThread() if the current instance of Win32Thread is the current thread? I have not found an alternative to pthread_equal() in the PThread Api.

Thanks for any hints
Markus

 
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-08  4:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-03  8:16 isCurrentThread() Markus Forrer
2021-04-03 22:15 ` isCurrentThread() ross.johnson
2021-04-08  4:43   ` isCurrentThread() Markus Forrer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).