dungeon_crawler
diff prototype/psys/psys.c @ 69:45172d087ebe
fixed some windows compatibility crap
fixed a terrible stack overrun in psys (TODO: remember to fix in libpsys too)
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 07 Oct 2012 03:42:44 +0200 |
parents | 2560a7ab0243 |
children |
line diff
1.1 --- a/prototype/psys/psys.c Sun Oct 07 02:05:11 2012 +0300 1.2 +++ b/prototype/psys/psys.c Sun Oct 07 03:42:44 2012 +0200 1.3 @@ -1,7 +1,7 @@ 1.4 #include <stdlib.h> 1.5 #include <math.h> 1.6 #include <assert.h> 1.7 -#include <pthread.h> 1.8 +/*#include <pthread.h>*/ 1.9 #include "psys.h" 1.10 #include "psys_gl.h" 1.11 1.12 @@ -11,7 +11,7 @@ 1.13 /* particle pool */ 1.14 static struct psys_particle *ppool; 1.15 static int ppool_size; 1.16 -static pthread_mutex_t pool_lock = PTHREAD_MUTEX_INITIALIZER; 1.17 +/*static pthread_mutex_t pool_lock = PTHREAD_MUTEX_INITIALIZER;*/ 1.18 1.19 static struct psys_particle *palloc(void); 1.20 static void pfree(struct psys_particle *p); 1.21 @@ -302,7 +302,7 @@ 1.22 { 1.23 struct psys_particle *p; 1.24 1.25 - pthread_mutex_lock(&pool_lock); 1.26 + /*pthread_mutex_lock(&pool_lock);*/ 1.27 if(ppool) { 1.28 p = ppool; 1.29 ppool = ppool->next; 1.30 @@ -310,16 +310,16 @@ 1.31 } else { 1.32 p = malloc(sizeof *p); 1.33 } 1.34 - pthread_mutex_unlock(&pool_lock); 1.35 + /*pthread_mutex_unlock(&pool_lock);*/ 1.36 1.37 return p; 1.38 } 1.39 1.40 static void pfree(struct psys_particle *p) 1.41 { 1.42 - pthread_mutex_lock(&pool_lock); 1.43 + /*pthread_mutex_lock(&pool_lock);*/ 1.44 p->next = ppool; 1.45 ppool = p; 1.46 ppool_size++; 1.47 - pthread_mutex_unlock(&pool_lock); 1.48 + /*pthread_mutex_unlock(&pool_lock);*/ 1.49 }