Author: loonycyborg
Date: Sat Dec 6 00:27:47 2008
New Revision: 31297
URL: http://svn.gna.org/viewcvs/wesnoth?rev=31297&view=rev
Log:
Use pthread_equal to compare thread ids.
Modified:
trunk/src/poolalloc.c
Modified: trunk/src/poolalloc.c
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/poolalloc.c?rev=31297&r1=31296&r2=31297&view=diff
==============================================================================
--- trunk/src/poolalloc.c (original)
+++ trunk/src/poolalloc.c Sat Dec 6 00:27:47 2008
@@ -324,7 +324,7 @@
void* malloc(size_t size)
{
- if(pthread_self() == main_thread && size > 0 && size <= MAX_CHUNK_SIZE)
{
+ if(pthread_equal(pthread_self(), main_thread) && size > 0 && size <=
MAX_CHUNK_SIZE) {
size = ROUNDUP_SIZE(size);
void* result = allocate_memory(size);
if(result != NULL) {
@@ -383,7 +383,7 @@
void free(void* ptr)
{
if(IS_OUR_PTR(ptr)) {
- if(pthread_self() != main_thread) {
+ if(!pthread_equal(pthread_self(), main_thread)) {
//this will queue up the free to be performed later in
the
//main thread when it wants more memory.
free_memory_from_other_thread(ptr);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits