Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
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
cpp-libs
libnice
Commits
d845fef9
Commit
d845fef9
authored
Feb 06, 2013
by
Bryce Allen
Committed by
Youness Alaoui
Feb 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
examples/sdp-example.c
examples/sdp-example.c
+3
-4
examples/threaded-example.c
examples/threaded-example.c
+3
-4
No files found.
examples/sdp-example.c
View file @
d845fef9
...
@@ -68,7 +68,7 @@ static void * example_thread(void *data);
...
@@ -68,7 +68,7 @@ static void * example_thread(void *data);
int
int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
GThread
*
g
loop
thread
;
GThread
*
g
example
thread
;
// Parse arguments
// Parse arguments
if
(
argc
>
4
||
argc
<
2
||
argv
[
1
][
1
]
!=
'\0'
)
{
if
(
argc
>
4
||
argc
<
2
||
argv
[
1
][
1
]
!=
'\0'
)
{
...
@@ -97,13 +97,12 @@ main(int argc, char *argv[])
...
@@ -97,13 +97,12 @@ main(int argc, char *argv[])
// Run the mainloop and the example thread
// Run the mainloop and the example thread
exit_thread
=
FALSE
;
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
);
g_main_loop_run
(
gloop
);
exit_thread
=
TRUE
;
exit_thread
=
TRUE
;
g_main_loop_unref
(
gloop
);
g_main_loop_unref
(
gloop
);
g_thread_join
(
gloopthread
);
g_thread_join
(
gexamplethread
);
g_thread_unref
(
gloopthread
);
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
...
...
examples/threaded-example.c
View file @
d845fef9
...
@@ -77,7 +77,7 @@ static void * example_thread(void *data);
...
@@ -77,7 +77,7 @@ static void * example_thread(void *data);
int
int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
GThread
*
g
loop
thread
;
GThread
*
g
example
thread
;
// Parse arguments
// Parse arguments
if
(
argc
>
4
||
argc
<
2
||
argv
[
1
][
1
]
!=
'\0'
)
{
if
(
argc
>
4
||
argc
<
2
||
argv
[
1
][
1
]
!=
'\0'
)
{
...
@@ -106,13 +106,12 @@ main(int argc, char *argv[])
...
@@ -106,13 +106,12 @@ main(int argc, char *argv[])
// Run the mainloop and the example thread
// Run the mainloop and the example thread
exit_thread
=
FALSE
;
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
);
g_main_loop_run
(
gloop
);
exit_thread
=
TRUE
;
exit_thread
=
TRUE
;
g_main_loop_unref
(
gloop
);
g_main_loop_unref
(
gloop
);
g_thread_join
(
gloopthread
);
g_thread_join
(
gexamplethread
);
g_thread_unref
(
gloopthread
);
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
...
...
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