condition: removed cond_timedwait() and cond_signal_async()
These methods are unused.
This commit is contained in:
parent
0d8ba194be
commit
b5c5a6b4c7
@ -50,28 +50,6 @@ void cond_wait(struct condition *cond)
|
||||
g_cond_wait(cond->cond, cond->mutex);
|
||||
}
|
||||
|
||||
int cond_timedwait(struct condition *cond, const long sec)
|
||||
{
|
||||
GTimeVal t;
|
||||
|
||||
g_get_current_time(&t);
|
||||
g_time_val_add(&t, sec * 1000000);
|
||||
|
||||
if (g_cond_timed_wait(cond->cond, cond->mutex, &t) == FALSE)
|
||||
return ETIMEDOUT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cond_signal_async(struct condition *cond)
|
||||
{
|
||||
if (g_mutex_trylock(cond->mutex) == FALSE) {
|
||||
g_cond_signal(cond->cond);
|
||||
g_mutex_unlock(cond->mutex);
|
||||
return 0;
|
||||
}
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
void cond_signal_sync(struct condition *cond)
|
||||
{
|
||||
g_cond_signal(cond->cond);
|
||||
|
@ -46,22 +46,6 @@ void cond_leave(struct condition *cond);
|
||||
*/
|
||||
void cond_wait(struct condition *cond);
|
||||
|
||||
/**
|
||||
* Wait for a condition with timeout
|
||||
*
|
||||
* @param sec number of seconds to wait for (subject to change)
|
||||
*
|
||||
* @return ETIMEDOUT if timed out, 0 if notification was received
|
||||
*/
|
||||
int cond_timedwait(struct condition *cond, const long sec);
|
||||
|
||||
/**
|
||||
* Notify the thread there is a waiter. This function never blocks.
|
||||
*
|
||||
* @return EBUSY if it was unable to lock the mutex, 0 on success
|
||||
*/
|
||||
int cond_signal_async(struct condition *cond);
|
||||
|
||||
/**
|
||||
* Notify the thread synchronously, i.e. wait until it can deliver
|
||||
* the notification.
|
||||
|
Loading…
Reference in New Issue
Block a user