summaryrefslogtreecommitdiff
path: root/pthread_self.c
diff options
context:
space:
mode:
authorrpj <rpj>2004-05-17 01:38:02 +0000
committerrpj <rpj>2004-05-17 01:38:02 +0000
commit771465fed0cf50ee2dd790723245fc091699c324 (patch)
treed8c18d095a33fe7c4564bd90c5f313bb9e4057dd /pthread_self.c
parent8b14911744f58cbe3730703f3fcc41cd969fd0f3 (diff)
re-indentation, bug fixes, hooks for pre-emptive async cancelation
Diffstat (limited to 'pthread_self.c')
-rw-r--r--pthread_self.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/pthread_self.c b/pthread_self.c
index 61979cd..5cad22a 100644
--- a/pthread_self.c
+++ b/pthread_self.c
@@ -55,7 +55,7 @@ pthread_self (void)
* thread.
*
* RESULTS
- * pthread_t reference to the current thread
+ * pthread_t reference to the current thread
*
* ------------------------------------------------------
*/
@@ -63,8 +63,8 @@ pthread_self (void)
pthread_t self;
#ifdef _UWIN
- if(!ptw32_selfThreadKey)
- return(NULL);
+ if (!ptw32_selfThreadKey)
+ return (NULL);
#endif
self = (pthread_t) pthread_getspecific (ptw32_selfThreadKey);
@@ -75,7 +75,7 @@ pthread_self (void)
* Need to create an implicit 'self' for the currently
* executing thread.
*/
- self = ptw32_new();
+ self = ptw32_new ();
if (self != NULL)
{
@@ -99,28 +99,25 @@ pthread_self (void)
* Therefore, you should not pass the handle to
* other threads for whatever purpose.
*/
- self->threadH = GetCurrentThread();
+ self->threadH = GetCurrentThread ();
#else
- if( !DuplicateHandle(
- GetCurrentProcess(),
- GetCurrentThread(),
- GetCurrentProcess(),
- &self->threadH,
- 0,
- FALSE,
- DUPLICATE_SAME_ACCESS ) )
+ if (!DuplicateHandle (GetCurrentProcess (),
+ GetCurrentThread (),
+ GetCurrentProcess (),
+ &self->threadH,
+ 0, FALSE, DUPLICATE_SAME_ACCESS))
{
/* Thread structs are never freed. */
- ptw32_threadReusePush(self);
+ ptw32_threadReusePush (self);
return (NULL);
}
#endif
- /*
- * No need to explicitly serialise access to sched_priority
- * because the new handle is not yet public.
- */
- self->sched_priority = GetThreadPriority(self->threadH);
+ /*
+ * No need to explicitly serialise access to sched_priority
+ * because the new handle is not yet public.
+ */
+ self->sched_priority = GetThreadPriority (self->threadH);
}
pthread_setspecific (ptw32_selfThreadKey, self);