summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/cygthread.h')
-rw-r--r--winsup/cygwin/cygthread.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/winsup/cygwin/cygthread.h b/winsup/cygwin/cygthread.h
index 593cfdd0a..cf1fd4102 100644
--- a/winsup/cygwin/cygthread.h
+++ b/winsup/cygwin/cygthread.h
@@ -31,7 +31,8 @@ class cygthread
bool is_freerange;
static bool exiting;
HANDLE notify_detached;
- void create () __attribute__ ((regparm(1)));
+ bool standalone;
+ void create () __attribute__ ((regparm(2)));
public:
bool terminate_thread ();
static DWORD WINAPI stub (VOID *);
@@ -42,13 +43,27 @@ class cygthread
void auto_release () {func = NULL;}
void release (bool);
cygthread (LPTHREAD_START_ROUTINE start, unsigned n, LPVOID param, const char *name, HANDLE notify = NULL)
- : __name (name), func (start), arglen (n), arg (param), notify_detached (notify)
+ : __name (name), func (start), arglen (n), arg (param), notify_detached (notify), standalone (false)
+ {
+ create ();
+ }
+ cygthread (LPVOID_THREAD_START_ROUTINE start, LPVOID param, const char *name, HANDLE notify = NULL)
+ : __name (name), func ((LPTHREAD_START_ROUTINE) start), arglen (0),
+ arg (param), notify_detached (notify), standalone (true)
+ {
+ create ();
+ /* This is a neverending/high-priority thread */
+ ::SetThreadPriority (h, THREAD_PRIORITY_HIGHEST);
+ zap_h ();
+ }
+ cygthread (LPTHREAD_START_ROUTINE start, LPVOID param, const char *name, HANDLE notify = NULL)
+ : __name (name), func (start), arglen (0), arg (param), notify_detached (notify), standalone (false)
{
create ();
}
cygthread (LPVOID_THREAD_START_ROUTINE start, unsigned n, LPVOID param, const char *name, HANDLE notify = NULL)
: __name (name), func ((LPTHREAD_START_ROUTINE) start), arglen (n),
- arg (param), notify_detached (notify)
+ arg (param), notify_detached (notify), standalone (true)
{
create ();
/* This is a neverending/high-priority thread */