]> git.pond.sub.org Git - empserver/blobdiff - src/lib/empthread/pthread.c
Permit empth_self() before empth_init()
[empserver] / src / lib / empthread / pthread.c
index 83f2b6c4e96f1699ffd734113c3c8a17b42d3ef7..9c7b24fd03c5a9ef34677dae4ae505f2d193467a 100644 (file)
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     Sasha Mikheev
  *     Steve McClure, 1998
- *     Markus Armbruster, 2005-2011
+ *     Markus Armbruster, 2005-2012
  *     Ron Koenderink, 2007-2009
  */
 
@@ -240,7 +240,7 @@ empth_restorectx(void)
 empth_t *
 empth_self(void)
 {
-    return pthread_getspecific(ctx_key);
+    return udata ? pthread_getspecific(ctx_key) : NULL;
 }
 
 char *