diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-05-22 22:53:09 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-05-22 22:53:09 +0000 |
commit | c1b4872b0910c9aa784d878dca771b21c4690048 (patch) | |
tree | 2ca5aea3f57c1336ab3165b94a385da9db72c00f /thread.c | |
parent | b60e60dbaeff9311b3e74a6d54bb3bbb2c1f61e3 (diff) |
lots of work
git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@30 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -143,6 +143,20 @@ sa_thread_t* sa_thread_self(void) { return t; } +int sa_thread_is_self(sa_thread_t *t) { + sa_thread_t *c; + sa_assert(t); + + if (sa_once(&thread_tls_once, thread_tls_once_func) < 0 || !thread_tls) + return 0; + + if ((c = sa_tls_get(thread_tls))) + return c == t; + + return 0; +} + + void* sa_thread_get_data(sa_thread_t *t) { sa_assert(t); |