Skip to content

Commit 72c24ca

Browse files
committed
common/threading: add THREAD_DETACH
1 parent 7fda996 commit 72c24ca

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

include/rfb/threading.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#define THREAD_ROUTINE_RETURN_VALUE NULL
5858
#define THREAD_SLEEP_MS(ms) usleep(ms*1000)
5959
#define THREAD_JOIN(thread) pthread_join(thread, NULL)
60+
#define THREAD_DETACH(thread) pthread_detach(thread)
6061
#define CURRENT_THREAD_ID pthread_self()
6162
#endif
6263
#elif defined(LIBVNCSERVER_HAVE_WIN32THREADS)
@@ -77,6 +78,7 @@
7778
#define THREAD_ROUTINE_RETURN_VALUE
7879
#define THREAD_SLEEP_MS(ms) Sleep(ms)
7980
#define THREAD_JOIN(thread) WaitForSingleObject((HANDLE)thread, INFINITE)
81+
#define THREAD_DETACH(thread) CloseHandle((HANDLE)thread)
8082
#define CURRENT_THREAD_ID GetCurrentThreadId()
8183
#else
8284
#define LOCK(mutex)

0 commit comments

Comments
 (0)