Skip to content

Commit

Permalink
Fix AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
XVilka committed Apr 25, 2018
1 parent a24eb63 commit 8a224a5
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions libr/util/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,22 @@ R_API bool r_th_pause(RThread *th, bool enable) {

// running in thread
R_API bool r_th_try_pause(RThread *th) {
if (th) {
// pthread_mutex_lock (&th->_mutex);
// pthread_mutex_unlock (&th->_mutex);
if (pthread_mutex_trylock (&th->_mutex) != -1) {
pthread_mutex_unlock (&th->_mutex);
} else {
// oops
}
// pthread_cond_wait (&th->_cond, &th->_mutex);
return true;
if (!th) {
return false;
}
return false;
#if HAVE_PTHREAD
// pthread_mutex_lock (&th->_mutex);
// pthread_mutex_unlock (&th->_mutex);
if (pthread_mutex_trylock (&th->_mutex) != -1) {
pthread_mutex_unlock (&th->_mutex);
} else {
// oops
}
// pthread_cond_wait (&th->_cond, &th->_mutex);
#else
#pragma message("warning r_th_try_pause not implemented")
#endif
return true;
}

R_API bool r_th_start(RThread *th, int enable) {
Expand Down

0 comments on commit 8a224a5

Please sign in to comment.