Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
6ffa65f1
Commit
6ffa65f1
authored
May 01, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get rid of X locks, there were missing glock/gunlock here and there
parent
9463903d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
27 deletions
+21
-27
common/utils/T/tracer/gui/gui.c
common/utils/T/tracer/gui/gui.c
+9
-3
common/utils/T/tracer/gui/init.c
common/utils/T/tracer/gui/init.c
+5
-2
common/utils/T/tracer/gui/loop.c
common/utils/T/tracer/gui/loop.c
+7
-0
common/utils/T/tracer/gui/x.c
common/utils/T/tracer/gui/x.c
+0
-17
common/utils/T/tracer/gui/x.h
common/utils/T/tracer/gui/x.h
+0
-5
No files found.
common/utils/T/tracer/gui/gui.c
View file @
6ffa65f1
...
...
@@ -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
;
}
common/utils/T/tracer/gui/init.c
View file @
6ffa65f1
...
...
@@ -12,8 +12,6 @@ gui *gui_init(void)
{
struct
gui
*
ret
;
x_init_threading
();
ret
=
calloc
(
1
,
sizeof
(
struct
gui
));
if
(
ret
==
NULL
)
OOM
;
...
...
@@ -25,7 +23,12 @@ gui *gui_init(void)
if
(
pipe
(
ret
->
event_pipe
))
ERR
(
"%s
\n
"
,
strerror
(
errno
));
/* lock not necessary but there for consistency (when instrumenting x.c
* we need the gui to be locked when calling any function in x.c)
*/
glock
(
ret
);
ret
->
x
=
x_open
();
gunlock
(
ret
);
return
ret
;
}
common/utils/T/tracer/gui/loop.c
View file @
6ffa65f1
...
...
@@ -16,14 +16,21 @@ void gui_loop(gui *_gui)
int
maxfd
;
fd_set
rd
;
/* lock not necessary but there for consistency (when instrumenting x.c
* we need the gui to be locked when calling any function in x.c)
*/
glock
(
g
);
xfd
=
x_connection_fd
(
g
->
x
);
gunlock
(
g
);
eventfd
=
g
->
event_pipe
[
0
];
if
(
eventfd
>
xfd
)
maxfd
=
eventfd
;
else
maxfd
=
xfd
;
while
(
1
)
{
glock
(
g
);
x_flush
(
g
->
x
);
gunlock
(
g
);
FD_ZERO
(
&
rd
);
FD_SET
(
xfd
,
&
rd
);
FD_SET
(
eventfd
,
&
rd
);
...
...
common/utils/T/tracer/gui/x.c
View file @
6ffa65f1
...
...
@@ -6,23 +6,6 @@
#include <stdlib.h>
#include <string.h>
void
x_init_threading
(
void
)
{
if
(
XInitThreads
()
==
False
)
abort
();
}
void
xlock
(
x_connection
*
_x
)
{
struct
x_connection
*
x
=
_x
;
XLockDisplay
(
x
->
d
);
}
void
xunlock
(
x_connection
*
_x
)
{
struct
x_connection
*
x
=
_x
;
XUnlockDisplay
(
x
->
d
);
}
int
x_connection_fd
(
x_connection
*
_x
)
{
struct
x_connection
*
x
=
_x
;
...
...
common/utils/T/tracer/gui/x.h
View file @
6ffa65f1
...
...
@@ -6,11 +6,6 @@
typedef
void
x_connection
;
typedef
void
x_window
;
void
x_init_threading
(
void
);
void
xlock
(
x_connection
*
x
);
void
xunlock
(
x_connection
*
x
);
x_connection
*
x_open
(
void
);
x_window
*
x_create_window
(
x_connection
*
x
,
int
width
,
int
height
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment