* Sasha Mikheev
* Doug Hay, 1998
* Steve McClure, 1998
- * Markus Armbruster, 2005-2009
+ * Markus Armbruster, 2005-2012
* Ron Koenderink, 2005-2009
*/
int size, int flags, char *name, void *ud);
/*
- * Return the current thread.
+ * Return the current thread, NULL before empth_init().
+ * This is the only function that may be called before empth_init().
*/
empth_t *empth_self(void);
* Known contributors to this file:
* Sasha Mikheev
* Steve McClure, 1998
- * Markus Armbruster, 2005-2011
+ * Markus Armbruster, 2005-2012
* Ron Koenderink, 2007-2009
*/
empth_t *
empth_self(void)
{
- return pthread_getspecific(ctx_key);
+ return udata ? pthread_getspecific(ctx_key) : NULL;
}
char *