Turn all mutexes into critical sections
Removing all win32 mutexes and turning them into critical sections, since mutexes in win32 are meant generally for inter process communication, tend to be slower, and aren't really needed for current purposes. Critical sections are roughly equivalent to std::mutex in the c++ stl.
This commit is contained in:
@@ -142,7 +142,6 @@ extern void ioctl_close(uint8_t id);
|
||||
typedef void thread_t;
|
||||
typedef void event_t;
|
||||
typedef void mutex_t;
|
||||
typedef void lightmutex_t;
|
||||
|
||||
extern thread_t *thread_create(void (*thread_func)(void *param), void *param);
|
||||
extern void thread_kill(thread_t *arg);
|
||||
@@ -153,19 +152,14 @@ extern void thread_reset_event(event_t *arg);
|
||||
extern int thread_wait_event(event_t *arg, int timeout);
|
||||
extern void thread_destroy_event(event_t *arg);
|
||||
|
||||
#define MUTEX_DEFAULT_SPIN_COUNT 1024
|
||||
|
||||
extern mutex_t *thread_create_mutex(void);
|
||||
extern mutex_t *thread_create_mutex_with_spin_count(unsigned int spin_count);
|
||||
extern void thread_close_mutex(mutex_t *arg);
|
||||
extern int thread_wait_mutex(mutex_t *arg);
|
||||
extern int thread_release_mutex(mutex_t *mutex);
|
||||
|
||||
#define LIGHT_MUTEX_DEFAULT_SPIN_COUNT 1024
|
||||
|
||||
lightmutex_t *thread_create_light_mutex();
|
||||
lightmutex_t *thread_create_light_mutex_and_spin_count(unsigned int spin_count);
|
||||
int thread_wait_light_mutex(lightmutex_t *lightmutex);
|
||||
int thread_release_light_mutex(lightmutex_t *lightmutex);
|
||||
void thread_close_light_mutex(lightmutex_t *lightmutex);
|
||||
|
||||
/* Other stuff. */
|
||||
extern void startblit(void);
|
||||
extern void endblit(void);
|
||||
|
||||
@@ -491,7 +491,7 @@ typedef struct voodoo_t
|
||||
|
||||
int force_blit_count;
|
||||
int can_blit;
|
||||
lightmutex_t* force_blit_mutex;
|
||||
mutex_t* force_blit_mutex;
|
||||
|
||||
int use_recompiler;
|
||||
void *codegen_data;
|
||||
|
||||
Reference in New Issue
Block a user