summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-09-30 23:40:05 +0200
committerMichael Stahl <mstahl@redhat.com>2016-09-30 23:45:05 +0200
commit8e7997fe0c4f5a20918fbaabc1a00fd0db070b95 (patch)
tree67c6b4bed8e79077430ed95d6c4b78d78c1cf3a3 /sal
parent33a2e47c907f7e2c1995b4a1e910dec94c3cedb4 (diff)
sal: WNT: print errno when oslCreateThread fails
Change-Id: Iad0a2a7ba68b3f43c22e0b5a3cee646f8baba30e
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/thread.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c
index eb7f222ec5d6..28b5f1147016 100644
--- a/sal/osl/w32/thread.c
+++ b/sal/osl/w32/thread.c
@@ -25,6 +25,7 @@
#include <osl/time.h>
#include <osl/interlck.h>
#include <rtl/tencinfo.h>
+#include <errno.h>
/*
Thread-data structure hidden behind oslThread:
@@ -94,6 +95,25 @@ static oslThread oslCreateThread(oslWorkerFunction pWorker,
if(pThreadImpl->m_hThread == 0)
{
+ switch (errno)
+ {
+ case EAGAIN:
+ fprintf(stderr, "_beginthreadex errno EAGAIN\n");
+ break;
+ case EINVAL:
+ fprintf(stderr, "_beginthreadex errno EINVAL\n");
+ break;
+ case EACCES:
+ fprintf(stderr, "_beginthreadex errno EACCES\n");
+ break;
+ case ENOMEM:
+ fprintf(stderr, "_beginthreadex undocumented errno ENOMEM - this means not enough VM for stack\n");
+ break;
+ default:
+ fprintf(stderr, "_beginthreadex unexpected errno %d\n", errno);
+ break;
+ }
+
/* create failed */
free(pThreadImpl);
return 0;