aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/ui/browser.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-02-17 14:46:35 +0100
committerIngo Molnar <mingo@elte.hu>2011-02-17 14:46:35 +0100
commitbee96907383e71d3996ba2bd0682fefaa492d942 (patch)
tree3233fb93a559eabd05581373ce41d342e956d79e /tools/perf/util/ui/browser.c
parent5beda5f6e4e4523e8dbe596bf163a01b45776808 (diff)
parent8737ebdea02315eaffaebb3b73d55f2f726a4fe0 (diff)
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
Diffstat (limited to 'tools/perf/util/ui/browser.c')
-rw-r--r--tools/perf/util/ui/browser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/ui/browser.c b/tools/perf/util/ui/browser.c
index 8bc010edca2..60d6c815e1d 100644
--- a/tools/perf/util/ui/browser.c
+++ b/tools/perf/util/ui/browser.c
@@ -1,4 +1,5 @@
#include "libslang.h"
+#include "ui.h"
#include <linux/compiler.h>
#include <linux/list.h>
#include <linux/rbtree.h>
@@ -178,6 +179,7 @@ int ui_browser__show(struct ui_browser *self, const char *title,
if (self->sb == NULL)
return -1;
+ pthread_mutex_lock(&ui__lock);
SLsmg_gotorc(0, 0);
ui_browser__set_color(self, NEWT_COLORSET_ROOT);
slsmg_write_nstring(title, self->width);
@@ -188,25 +190,30 @@ int ui_browser__show(struct ui_browser *self, const char *title,
va_start(ap, helpline);
ui_helpline__vpush(helpline, ap);
va_end(ap);
+ pthread_mutex_unlock(&ui__lock);
return 0;
}
void ui_browser__hide(struct ui_browser *self)
{
+ pthread_mutex_lock(&ui__lock);
newtFormDestroy(self->form);
self->form = NULL;
ui_helpline__pop();
+ pthread_mutex_unlock(&ui__lock);
}
int ui_browser__refresh(struct ui_browser *self)
{
int row;
+ pthread_mutex_lock(&ui__lock);
newtScrollbarSet(self->sb, self->index, self->nr_entries - 1);
row = self->refresh(self);
ui_browser__set_color(self, HE_COLORSET_NORMAL);
SLsmg_fill_region(self->y + row, self->x,
self->height - row, self->width, ' ');
+ pthread_mutex_unlock(&ui__lock);
return 0;
}