ObjFW  Check-in [cbf1901c7f]

Overview
Comment:Add OF_ prefix to a private method missing it.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cbf1901c7fe5625d263b2cfcd94d5ba68a925ace4320f8fa7d40c8b1a404d738
User & Date: js on 2012-10-26 10:16:45
Other Links: manifest | tags
Context
2012-10-26
11:04
Split OFThread.m into multiple files. check-in: 0a55edad35 user: js tags: trunk
10:16
Add OF_ prefix to a private method missing it. check-in: cbf1901c7f user: js tags: trunk
2012-10-25
18:43
PLATFORMS.md: Add Windows 8. check-in: 69a81995bf user: js tags: trunk
Changes

Modified src/OFThread.h from [f7ea444098] to [ac4e14b1b1].

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 * \brief Creates a new Thread Local Storage key with the specified destructor.
 *
 * \param destructor A destructor that is called when the thread is terminated
 * \return A new autoreleased Thread Local Storage key
 */
+ (instancetype)TLSKeyWithDestructor: (void(*)(id))destructor;

+ (void)callAllDestructors;

/**
 * \brief Initializes an already allocated Thread Local Storage Key with the
 *	  specified destructor.
 *
 * \param destructor A destructor that is called when the thread is terminated
 * \return An initialized Thread Local Storage key







|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 * \brief Creates a new Thread Local Storage key with the specified destructor.
 *
 * \param destructor A destructor that is called when the thread is terminated
 * \return A new autoreleased Thread Local Storage key
 */
+ (instancetype)TLSKeyWithDestructor: (void(*)(id))destructor;

+ (void)OF_callAllDestructors;

/**
 * \brief Initializes an already allocated Thread Local Storage Key with the
 *	  specified destructor.
 *
 * \param destructor A destructor that is called when the thread is terminated
 * \return An initialized Thread Local Storage key

Modified src/OFThread.m from [bab03511a5] to [dca7dfad37].

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#endif
		thread->returnValue = [[thread main] retain];

	[thread handleTermination];

	thread->running = OF_THREAD_WAITING_FOR_JOIN;

	[OFTLSKey callAllDestructors];
#ifdef OF_OBJFW_RUNTIME
	/*
	 * As the values returned by objc_autoreleasePoolPush() in the ObjFW
	 * runtime are not actually pointers, but sequential numbers, 0 means
	 * we pop everything.
	 */
	objc_autoreleasePoolPop(0);







|







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#endif
		thread->returnValue = [[thread main] retain];

	[thread handleTermination];

	thread->running = OF_THREAD_WAITING_FOR_JOIN;

	[OFTLSKey OF_callAllDestructors];
#ifdef OF_OBJFW_RUNTIME
	/*
	 * As the values returned by objc_autoreleasePoolPush() in the ObjFW
	 * runtime are not actually pointers, but sequential numbers, 0 means
	 * we pop everything.
	 */
	objc_autoreleasePoolPop(0);
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
		thread->returnValue = [object retain];

		[thread handleTermination];

		thread->running = OF_THREAD_WAITING_FOR_JOIN;
	}

	[OFTLSKey callAllDestructors];
#ifdef OF_OBJFW_RUNTIME
	/*
	 * As the values returned by objc_autoreleasePoolPush() in the ObjFW
	 * runtime are not actually pointers, but sequential numbers, 0 means
	 * we pop everything.
	 */
	objc_autoreleasePoolPop(0);







|







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
		thread->returnValue = [object retain];

		[thread handleTermination];

		thread->running = OF_THREAD_WAITING_FOR_JOIN;
	}

	[OFTLSKey OF_callAllDestructors];
#ifdef OF_OBJFW_RUNTIME
	/*
	 * As the values returned by objc_autoreleasePoolPush() in the ObjFW
	 * runtime are not actually pointers, but sequential numbers, 0 means
	 * we pop everything.
	 */
	objc_autoreleasePoolPop(0);
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
}

+ (instancetype)TLSKeyWithDestructor: (void(*)(id))destructor
{
	return [[[self alloc] initWithDestructor: destructor] autorelease];
}

+ (void)callAllDestructors
{
	of_list_object_t *iter;

	@synchronized (TLSKeys) {
		for (iter = [TLSKeys firstListObject]; iter != NULL;
		    iter = iter->next) {
			OFTLSKey *key = (OFTLSKey*)iter->object;







|







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
}

+ (instancetype)TLSKeyWithDestructor: (void(*)(id))destructor
{
	return [[[self alloc] initWithDestructor: destructor] autorelease];
}

+ (void)OF_callAllDestructors
{
	of_list_object_t *iter;

	@synchronized (TLSKeys) {
		for (iter = [TLSKeys firstListObject]; iter != NULL;
		    iter = iter->next) {
			OFTLSKey *key = (OFTLSKey*)iter->object;