Cleanup
This commit is contained in:
@@ -95,7 +95,3 @@ void iron_thread_set_name(const char *name) {
|
||||
pthread_setname_np(name);
|
||||
#endif
|
||||
}
|
||||
|
||||
void iron_thread_sleep(int milliseconds) {
|
||||
usleep(1000 * (useconds_t)milliseconds);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ void iron_threads_init() {}
|
||||
|
||||
void iron_threads_quit() {}
|
||||
|
||||
void iron_thread_sleep(int milliseconds) {}
|
||||
|
||||
void iron_mutex_init(iron_mutex_t *mutex) {}
|
||||
|
||||
void iron_mutex_destroy(iron_mutex_t *mutex) {}
|
||||
|
||||
@@ -66,10 +66,6 @@ void iron_thread_set_name(const char *name) {
|
||||
}
|
||||
}
|
||||
|
||||
void iron_thread_sleep(int milliseconds) {
|
||||
Sleep(milliseconds);
|
||||
}
|
||||
|
||||
void iron_mutex_init(iron_mutex_t *mutex) {
|
||||
InitializeCriticalSection((LPCRITICAL_SECTION)&mutex->impl.criticalSection);
|
||||
}
|
||||
|
||||
+5
-3
@@ -352,8 +352,7 @@ unsigned char *iron_deflate_raw(unsigned char *data, int data_len, int *out_len,
|
||||
#include "sinfl.h"
|
||||
#endif
|
||||
#if defined(IDLE_SLEEP) && !defined(IRON_WINDOWS)
|
||||
// #include <unistd.h>
|
||||
int usleep(unsigned int usec);
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef IRON_MACOS
|
||||
@@ -397,7 +396,10 @@ void _update(void *data) {
|
||||
#ifdef IRON_WINDOWS
|
||||
Sleep(1);
|
||||
#else
|
||||
usleep(1000);
|
||||
struct timespec t;
|
||||
t.tv_sec = 0;
|
||||
t.tv_nsec = 1000000;
|
||||
nanosleep(&t, NULL);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ void iron_thread_init(iron_thread_t *thread, void (*func)(void *param), void *pa
|
||||
void iron_thread_wait_and_destroy(iron_thread_t *thread);
|
||||
bool iron_thread_try_to_destroy(iron_thread_t *thread);
|
||||
void iron_thread_set_name(const char *name);
|
||||
void iron_thread_sleep(int milliseconds);
|
||||
|
||||
typedef struct iron_mutex {
|
||||
iron_mutex_impl_t impl;
|
||||
|
||||
Reference in New Issue
Block a user