ObjFW  Diff

Differences From Artifact [3758706d1f]:

To Artifact [6151851d64]:


11
12
13
14
15
16
17

18

19
20
21
22
23
24
25
26
27
28
29
30
11
12
13
14
15
16
17
18

19
20
21
22


23
24
25
26
27
28
29







+
-
+



-
-







 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"
#define OF_THREAD_M

#define _POSIX_TIMERS
#define __NO_EXT_QNX

#include "config.h"

#include <errno.h>

#include <stdlib.h>
#include <math.h>
#include <time.h>

#ifdef OF_HAVE_SCHED_YIELD
88
89
90
91
92
93
94



95


96
97
98
99
100
101
102
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106







+
+
+

+
+







# import "tlskey.h"
# if defined(OF_AMIGAOS) && defined(OF_HAVE_SOCKETS)
#  import "socket.h"
# endif

static of_tlskey_t threadSelfKey;
static OFThread *mainThread;
#elif defined(OF_HAVE_SOCKETS)
static OFDNSResolver *DNSResolver;
#endif

@implementation OFThread
#ifdef OF_HAVE_THREADS
static void
callMain(id object)
{
	OFThread *thread = (OFThread *)object;
	OFString *name;

	if (!of_tlskey_set(threadSelfKey, thread))
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
145
146
147
148
149
150
151



152


153
154
155
156
157
158
159







-
-
-

-
-







		of_socket_deinit();
#endif

	thread->_running = OF_THREAD_WAITING_FOR_JOIN;

	[thread release];
}
#elif defined(OF_HAVE_SOCKETS)
static OFDNSResolver *DNSResolver;
#endif

@implementation OFThread
#ifdef OF_HAVE_THREADS
@synthesize name = _name;
# ifdef OF_HAVE_BLOCKS
@synthesize threadBlock = _threadBlock;
# endif

+ (void)initialize
{