1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/*
* Copyright (c) 2008 - 2010
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#include "config.h"
#import "OFThread.h"
#import "OFList.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#import "threading.h"
|
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/*
* Copyright (c) 2008 - 2010
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#include "config.h"
#ifndef _WIN32
# include <unistd.h>
#else
# include <windows.h>
#endif
#import "OFThread.h"
#import "OFList.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#import "threading.h"
|
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
return [[of_tlskey_get(key->key) retain] autorelease];
}
+ (OFThread*)currentThread
{
return of_tlskey_get(thread_self);
}
+ (void)terminate
{
[self terminateWithObject: nil];
}
+ (void)terminateWithObject: (id)obj
|
>
>
>
>
>
>
>
>
>
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
return [[of_tlskey_get(key->key) retain] autorelease];
}
+ (OFThread*)currentThread
{
return of_tlskey_get(thread_self);
}
+ (void)sleepForNMilliseconds: (unsigned int)msecs;
{
#ifndef _WIN32
usleep(msecs * 1000);
#else
Sleep(msecs);
#endif
}
+ (void)terminate
{
[self terminateWithObject: nil];
}
+ (void)terminateWithObject: (id)obj
|