ObjFW  Diff

Differences From Artifact [06c9cd7dc5]:

To Artifact [6e21212113]:


45
46
47
48
49
50
51
52
53
54
55

56


57
58
59
60
61
62
63
	pthread_once(control, function);
#elif defined(OF_HAVE_ATOMIC_OPS)
	/* Avoid atomic operations in case it's already done. */
	if (*control == 2)
		return;

	if (OFAtomicIntCompareAndSwap(control, 0, 1)) {
		function();

		OFMemoryBarrier();


		OFAtomicIntIncrease(control);


	} else
		while (*control == 1)
			OFYieldThread();
#elif defined(OF_AMIGAOS)
	bool run = false;

	/* Avoid Forbid() in case it's already done. */







<
<
|

>

>
>







45
46
47
48
49
50
51


52
53
54
55
56
57
58
59
60
61
62
63
64
	pthread_once(control, function);
#elif defined(OF_HAVE_ATOMIC_OPS)
	/* Avoid atomic operations in case it's already done. */
	if (*control == 2)
		return;

	if (OFAtomicIntCompareAndSwap(control, 0, 1)) {


		OFAcquireMemoryBarrier();

		function();
		OFAtomicIntIncrease(control);

		OFReleaseMemoryBarrier();
	} else
		while (*control == 1)
			OFYieldThread();
#elif defined(OF_AMIGAOS)
	bool run = false;

	/* Avoid Forbid() in case it's already done. */