Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
d1659e38
Commit
d1659e38
authored
Feb 04, 2013
by
Ghislain MARY
Browse files
Threads are no longer needed.
parent
1094abe5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
57 deletions
+2
-57
src/belle_sip_resolver.c
src/belle_sip_resolver.c
+2
-2
src/port.c
src/port.c
+0
-31
src/port.h
src/port.h
+0
-22
tester/belle_sip_dialog_tester.c
tester/belle_sip_dialog_tester.c
+0
-1
tester/belle_sip_register_tester.c
tester/belle_sip_register_tester.c
+0
-1
No files found.
src/belle_sip_resolver.c
View file @
d1659e38
...
...
@@ -261,9 +261,9 @@ unsigned long belle_sip_resolve(belle_sip_stack_t *stack, const char *name, int
return
0
;
}
/*
t
he resolver context must never be removed manually from the main loop*/
/*
T
he resolver context must never be removed manually from the main loop
*/
belle_sip_main_loop_add_source
(
ml
,(
belle_sip_source_t
*
)
ctx
);
belle_sip_object_unref
(
ctx
);
/*
t
he main loop
and the thread have
a ref on it*/
belle_sip_object_unref
(
ctx
);
/*
T
he main loop
has
a ref on it
*/
return
ctx
->
source
.
id
;
}
else
{
cb
(
data
,
name
,
res
);
...
...
src/port.c
View file @
d1659e38
...
...
@@ -42,37 +42,6 @@ void belle_sip_uninit_sockets(void){
if
(
sockets_initd
==
0
)
WSACleanup
();
}
typedef
struct
thread_param
{
void
*
(
*
func
)(
void
*
);
void
*
arg
;
}
thread_param_t
;
static
unsigned
WINAPI
thread_starter
(
void
*
data
){
thread_param_t
*
params
=
(
thread_param_t
*
)
data
;
void
*
ret
=
params
->
func
(
params
->
arg
);
belle_sip_free
(
data
);
return
(
DWORD
)
ret
;
}
int
belle_sip_thread_create
(
belle_sip_thread_t
*
th
,
void
*
attr
,
void
*
(
*
func
)(
void
*
),
void
*
data
)
{
thread_param_t
*
params
=
belle_sip_new
(
thread_param_t
);
params
->
func
=
func
;
params
->
arg
=
data
;
*
th
=
(
HANDLE
)
_beginthreadex
(
NULL
,
0
,
thread_starter
,
params
,
0
,
NULL
);
return
0
;
}
int
belle_sip_thread_join
(
belle_sip_thread_t
thread_h
,
void
**
unused
)
{
if
(
thread_h
!=
NULL
)
{
WaitForSingleObject
(
thread_h
,
INFINITE
);
CloseHandle
(
thread_h
);
}
return
0
;
}
int
belle_sip_socket_set_nonblocking
(
belle_sip_socket_t
sock
)
{
unsigned
long
nonBlock
=
1
;
...
...
src/port.h
View file @
d1659e38
...
...
@@ -28,7 +28,6 @@
#include <netdb.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <pthread.h>
#else
...
...
@@ -104,27 +103,6 @@ static inline int get_socket_error(void){
#endif
/*
* Thread abstraction layer
*/
#ifdef WIN32
typedef
HANDLE
belle_sip_thread_t
;
int
belle_sip_thread_join
(
belle_sip_thread_t
thread
,
void
**
retptr
);
int
belle_sip_thread_create
(
belle_sip_thread_t
*
thread
,
void
*
attr
,
void
*
(
*
routine
)(
void
*
),
void
*
arg
);
#else
#include <pthread.h>
typedef
pthread_t
belle_sip_thread_t
;
#define belle_sip_thread_join(thread,retptr) pthread_join(thread,retptr)
#define belle_sip_thread_create(thread,attr,routine,arg) pthread_create(thread,attr,routine,arg)
#endif
#endif
...
...
tester/belle_sip_dialog_tester.c
View file @
d1659e38
...
...
@@ -19,7 +19,6 @@
#include <stdio.h>
#include "CUnit/Basic.h"
#include "belle-sip/belle-sip.h"
#include "pthread.h"
extern
belle_sip_stack_t
*
stack
;
extern
belle_sip_provider_t
*
prov
;
...
...
tester/belle_sip_register_tester.c
View file @
d1659e38
...
...
@@ -19,7 +19,6 @@
#include <stdio.h>
#include "CUnit/Basic.h"
#include "belle-sip/belle-sip.h"
#include "pthread.h"
const
char
*
test_domain
=
"test.linphone.org"
;
const
char
*
auth_domain
=
"sip.linphone.org"
;
...
...
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