get rid of X locks, there were missing glock/gunlock here and there
This commit is contained in:
@@ -9,18 +9,24 @@ void glock(gui *_gui)
|
||||
{
|
||||
struct gui *g = _gui;
|
||||
if (pthread_mutex_lock(g->lock)) ERR("mutex error\n");
|
||||
xlock(g->x);
|
||||
}
|
||||
|
||||
void gunlock(gui *_gui)
|
||||
{
|
||||
struct gui *g = _gui;
|
||||
xunlock(g->x);
|
||||
if (pthread_mutex_unlock(g->lock)) ERR("mutex error\n");
|
||||
}
|
||||
|
||||
int new_color(gui *_gui, char *color)
|
||||
{
|
||||
struct gui *g = _gui;
|
||||
return x_new_color(g->x, color);
|
||||
int ret;
|
||||
|
||||
glock(g);
|
||||
|
||||
ret = x_new_color(g->x, color);
|
||||
|
||||
gunlock(g);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user