Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
libnice
libnice
Commits
d845fef9
Commit
d845fef9
authored
Feb 06, 2013
by
Bryce Allen
Committed by
Youness Alaoui
Feb 06, 2013
Browse files
Do not unref the GThread since g_thread_join takes the reference. Also rename the variable.
parent
d34e48d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/sdp-example.c
View file @
d845fef9
...
...
@@ -68,7 +68,7 @@ static void * example_thread(void *data);
int
main
(
int
argc
,
char
*
argv
[])
{
GThread
*
g
loop
thread
;
GThread
*
g
example
thread
;
// Parse arguments
if
(
argc
>
4
||
argc
<
2
||
argv
[
1
][
1
]
!=
'\0'
)
{
...
...
@@ -97,13 +97,12 @@ main(int argc, char *argv[])
// Run the mainloop and the example thread
exit_thread
=
FALSE
;
g
loop
thread
=
g_thread_new
(
"example thread"
,
&
example_thread
,
NULL
);
g
example
thread
=
g_thread_new
(
"example thread"
,
&
example_thread
,
NULL
);
g_main_loop_run
(
gloop
);
exit_thread
=
TRUE
;
g_main_loop_unref
(
gloop
);
g_thread_join
(
gloopthread
);
g_thread_unref
(
gloopthread
);
g_thread_join
(
gexamplethread
);
return
EXIT_SUCCESS
;
}
...
...
examples/threaded-example.c
View file @
d845fef9
...
...
@@ -77,7 +77,7 @@ static void * example_thread(void *data);
int
main
(
int
argc
,
char
*
argv
[])
{
GThread
*
g
loop
thread
;
GThread
*
g
example
thread
;
// Parse arguments
if
(
argc
>
4
||
argc
<
2
||
argv
[
1
][
1
]
!=
'\0'
)
{
...
...
@@ -106,13 +106,12 @@ main(int argc, char *argv[])
// Run the mainloop and the example thread
exit_thread
=
FALSE
;
g
loop
thread
=
g_thread_new
(
"example thread"
,
&
example_thread
,
NULL
);
g
example
thread
=
g_thread_new
(
"example thread"
,
&
example_thread
,
NULL
);
g_main_loop_run
(
gloop
);
exit_thread
=
TRUE
;
g_main_loop_unref
(
gloop
);
g_thread_join
(
gloopthread
);
g_thread_unref
(
gloopthread
);
g_thread_join
(
gexamplethread
);
return
EXIT_SUCCESS
;
}
...
...
Write
Preview
Supports
Markdown
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