Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
EDAF55
C-camera
Commits
814e49d3
Commit
814e49d3
authored
Oct 26, 2017
by
Sven Gestegård Robertz
Browse files
small cleanup
parent
4ad8c9cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/http_server.c
View file @
814e49d3
...
...
@@ -435,8 +435,8 @@ static void join_bg_thread(pthread_t* bg_thread, const char* msg)
static
void
client_init
(
struct
client
*
client
)
{
client
->
cam
=
0
;
client
->
connfd
=
0
;
client
->
cam
=
NULL
;
client
->
connfd
=
-
1
;
}
int
serve_clients
(
struct
global_state
*
state
)
{
...
...
@@ -484,11 +484,11 @@ failed_to_alloc_client:
void
init_global_state
(
struct
global_state
*
state
)
{
pthread_mutex_lock
(
&
global_mutex
);
pthread_mutex_lock
(
&
global_mutex
);
state
->
running
=
0
;
state
->
quit
=
0
;
state
->
cam
=
NULL
;
pthread_mutex_unlock
(
&
global_mutex
);
pthread_mutex_unlock
(
&
global_mutex
);
}
int
is_running
(
struct
global_state
*
state
)
...
...
examples/motion_server.c
View file @
814e49d3
...
...
@@ -104,10 +104,6 @@ struct client{
static
int
client_write_string
(
struct
client
*
client
);
/////////////// client stuff
struct
client
;
pthread_mutex_t
global_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
pthread_cond_t
global_cond
=
PTHREAD_COND_INITIALIZER
;
...
...
@@ -493,12 +489,12 @@ failed_poll:
void
init_global_state
(
struct
global_state
*
state
)
{
pthread_mutex_lock
(
&
global_mutex
);
pthread_mutex_lock
(
&
global_mutex
);
state
->
running
=
0
;
state
->
quit
=
0
;
state
->
t_local
=
0
;
state
->
t_remote
=
0
;
pthread_mutex_unlock
(
&
global_mutex
);
pthread_mutex_unlock
(
&
global_mutex
);
}
int
create_socket
(
struct
global_state
*
state
)
...
...
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