ObjFW  Check-in [258b45b81a]

Overview
Comment:Fix compilation on Win32
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 258b45b81a95d77ec1a085dcbc2cbf576bf354a27d35677d2ff5c2ef3ec58976
User & Date: js on 2014-12-07 18:19:46
Other Links: manifest | tags
Context
2014-12-13
16:52
Use CLOEXEC for files and sockets check-in: 06d2de4571 user: js tags: trunk
2014-12-07
18:19
Fix compilation on Win32 check-in: 258b45b81a user: js tags: trunk
18:18
OFHTTPServer: Fix warning on Win64 check-in: 372ed8b399 user: js tags: trunk
Changes

Modified src/threading.m from [139fd47bbf] to [29688ac7bf].

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51


52
53
54
55
56
57
58
#ifdef __HAIKU__
# include <kernel/OS.h>
#endif

bool
of_rmutex_new(of_rmutex_t *rmutex)
{
#if defined(OF_HAVE_RECURSIVE_PTHREAD_MUTEXES) || defined(_WIN32)
	pthread_mutexattr_t attr;

	if (pthread_mutexattr_init(&attr) != 0)
		return false;

	if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0)
		return false;

	if (pthread_mutex_init(rmutex, &attr) != 0)
		return false;

	if (pthread_mutexattr_destroy(&attr) != 0)
		return false;

	return true;


#else
	if (!of_mutex_new(&rmutex->mutex))
		return false;

	if (!of_tlskey_new(&rmutex->count))
		return false;








|















>
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifdef __HAIKU__
# include <kernel/OS.h>
#endif

bool
of_rmutex_new(of_rmutex_t *rmutex)
{
#if defined(OF_HAVE_RECURSIVE_PTHREAD_MUTEXES)
	pthread_mutexattr_t attr;

	if (pthread_mutexattr_init(&attr) != 0)
		return false;

	if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0)
		return false;

	if (pthread_mutex_init(rmutex, &attr) != 0)
		return false;

	if (pthread_mutexattr_destroy(&attr) != 0)
		return false;

	return true;
#elif defined(_WIN32)
	return of_mutex_new(rmutex);
#else
	if (!of_mutex_new(&rmutex->mutex))
		return false;

	if (!of_tlskey_new(&rmutex->count))
		return false;