Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
e37c97a8
Commit
e37c97a8
authored
18 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
fix up problem of a thread being defined differently on different platforms.
parent
4027ab34
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/zmapThreads/zmapSlave.c
+16
-15
16 additions, 15 deletions
src/zmapThreads/zmapSlave.c
src/zmapThreads/zmapThreads.c
+5
-4
5 additions, 4 deletions
src/zmapThreads/zmapThreads.c
src/zmapThreads/zmapThreadsUtils.c
+3
-2
3 additions, 2 deletions
src/zmapThreads/zmapThreadsUtils.c
with
24 additions
and
21 deletions
src/zmapThreads/zmapSlave.c
+
16
−
15
View file @
e37c97a8
...
...
@@ -28,12 +28,13 @@
*
* Exported functions: See zmapConn_P.h
* HISTORY:
* Last edited:
Nov 7 16:53
200
6
(edgrif)
* Last edited:
Feb 21 15:21
200
7
(edgrif)
* Created: Thu Jul 24 14:37:26 2003 (edgrif)
* CVS info: $Id: zmapSlave.c,v 1.2
7
200
6-11
-0
8
09:
24:32
edgrif Exp $
* CVS info: $Id: zmapSlave.c,v 1.2
8
200
7-03
-0
1
09:
15:56
edgrif Exp $
*-------------------------------------------------------------------
*/
#include
<stdio.h>
#include
<strings.h>
/* YOU SHOULD BE AWARE THAT ON SOME PLATFORMS (E.G. ALPHAS) THERE SEEMS TO BE SOME INTERACTION
...
...
@@ -69,7 +70,7 @@ void *zmapNewThread(void *thread_args)
TIMESPEC
timeout
;
ZMapThreadRequest
signalled_state
;
ZMAPTHREAD_DEBUG
((
"%
lu
: main thread routine starting....
\n
"
,
t
hread
->
t
hread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: main thread routine starting....
\n
"
,
zMapT
hread
GetT
hread
ID
(
thread
)
))
;
/* We set up the thread struct and then immediately set up our pthread clean up routine
* to catch errors, if we are cancelled before this then the clean up routine will not
...
...
@@ -104,7 +105,7 @@ void *zmapNewThread(void *thread_args)
{
void
*
request
;
ZMAPTHREAD_DEBUG
((
"%
lu
: about to do timed wait
\n
"
,
t
hread
->
thread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: about to do timed wait
\n
"
,
zMapThreadGetT
hread
ID
(
thread
)
))
;
/* this will crap over performance...asking the time all the time !! */
timeout
.
tv_sec
=
5
;
/* n.b. interface seems to absolute time. */
...
...
@@ -113,7 +114,7 @@ void *zmapNewThread(void *thread_args)
signalled_state
=
zmapCondVarWaitTimed
(
thread_state
,
ZMAPTHREAD_REQUEST_WAIT
,
&
timeout
,
TRUE
,
&
request
)
;
ZMAPTHREAD_DEBUG
((
"%
lu
: finished condvar wait, state = %s
\n
"
,
t
hread
->
t
hread
_id
,
ZMAPTHREAD_DEBUG
((
"%
s
: finished condvar wait, state = %s
\n
"
,
zMapT
hread
GetT
hread
ID
(
thread
)
,
zMapThreadGetRequestString
(
signalled_state
)))
;
/* pthread_testcancel fix for MACOSX */
...
...
@@ -133,7 +134,7 @@ void *zmapNewThread(void *thread_args)
zMapAssert
(
request
)
;
/* this needs changing according to request.... */
ZMAPTHREAD_DEBUG
((
"%
lu
: servicing request....
\n
"
,
t
hread
->
thread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: servicing request....
\n
"
,
zMapThreadGetT
hread
ID
(
thread
)
))
;
zMapPrintTimer
(
NULL
,
"In thread, calling handler function"
)
;
...
...
@@ -151,7 +152,7 @@ void *zmapNewThread(void *thread_args)
{
case
ZMAPTHREAD_RETURNCODE_OK
:
{
ZMAPTHREAD_DEBUG
((
"%
lu
: got all data....
\n
"
,
t
hread
->
thread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: got all data....
\n
"
,
zMapThreadGetT
hread
ID
(
thread
)
))
;
/* Signal that we got some data. */
zmapVarSetValueWithData
(
&
(
thread
->
reply
),
ZMAPTHREAD_REPLY_GOTDATA
,
request
)
;
...
...
@@ -163,7 +164,7 @@ void *zmapNewThread(void *thread_args)
{
char
*
error_msg
;
ZMAPTHREAD_DEBUG
((
"%
lu
: request failed....
\n
"
,
t
hread
->
thread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: request failed....
\n
"
,
zMapThreadGetT
hread
ID
(
thread
)
))
;
error_msg
=
g_strdup_printf
(
"%s - %s"
,
ZMAPTHREAD_SLAVEREQUEST
,
slave_error
)
;
...
...
@@ -186,7 +187,7 @@ void *zmapNewThread(void *thread_args)
ZMAPTHREAD_DEBUG
((
"%
lu
: server died....
\n
"
,
t
hread
->
thread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: server died....
\n
"
,
zMapThreadGetT
hread
ID
(
thread
)
))
;
error_msg
=
g_strdup_printf
(
"%s - %s"
,
ZMAPTHREAD_SLAVEREQUEST
,
slave_error
)
;
...
...
@@ -235,7 +236,7 @@ void *zmapNewThread(void *thread_args)
pthread_cleanup_pop
(
1
)
;
/* 1 => always call clean up routine */
ZMAPTHREAD_DEBUG
((
"%
lu
: main thread routine exitting....
\n
"
,
t
hread
->
t
hread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: main thread routine exitting....
\n
"
,
zMapT
hread
GetT
hread
ID
(
thread
)
))
;
return
thread_args
;
...
...
@@ -261,7 +262,7 @@ static void cleanUpThread(void *thread_args)
zMapAssert
(
thread_args
)
;
ZMAPTHREAD_DEBUG
((
"%
lu
: thread clean-up routine starting....
\n
"
,
t
hread
->
t
hread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: thread clean-up routine starting....
\n
"
,
zMapT
hread
GetT
hread
ID
(
thread
)
))
;
if
(
thread_cb
->
thread_died
)
...
...
@@ -282,8 +283,8 @@ static void cleanUpThread(void *thread_args)
if
((
slave_response
=
(
*
(
thread
->
terminate_func
))(
&
(
thread_cb
->
slave_data
),
&
error_msg
))
!=
ZMAPTHREAD_RETURNCODE_OK
)
{
ZMAPTHREAD_DEBUG
((
"%
lu
: Unable to close connection to server cleanly
\n
"
,
t
hread
->
t
hread
_id
))
;
ZMAPTHREAD_DEBUG
((
"%
s
: Unable to close connection to server cleanly
\n
"
,
zMapT
hread
GetT
hread
ID
(
thread
)
))
;
}
}
...
...
@@ -295,8 +296,8 @@ static void cleanUpThread(void *thread_args)
zmapVarSetValueWithError
(
&
(
thread
->
reply
),
reply
,
error_msg
)
;
ZMAPTHREAD_DEBUG
((
"%
lu
: thread clean-up routine exitting because %s....
\n
"
,
t
hread
->
t
hread
_id
,
zMapThreadGetReplyString
(
reply
)))
;
ZMAPTHREAD_DEBUG
((
"%
s
: thread clean-up routine exitting because %s....
\n
"
,
zMapT
hread
GetT
hread
ID
(
thread
)
,
zMapThreadGetReplyString
(
reply
)))
;
return
;
}
...
...
This diff is collapsed.
Click to expand it.
src/zmapThreads/zmapThreads.c
+
5
−
4
View file @
e37c97a8
...
...
@@ -29,12 +29,13 @@
*
* Exported functions: See ZMap/zmapThread.h
* HISTORY:
* Last edited:
Jan 31 11:50
2007 (edgrif)
* Last edited:
Feb 21 15:06
2007 (edgrif)
* Created: Thu Jan 27 11:25:37 2005 (edgrif)
* CVS info: $Id: zmapThreads.c,v 1.
5
2007-0
2-27 10:37:40 zmap
Exp $
* CVS info: $Id: zmapThreads.c,v 1.
6
2007-0
3-01 09:15:56 edgrif
Exp $
*-------------------------------------------------------------------
*/
#include
<stdio.h>
#include
<string.h>
#include
<ZMap/zmapUtils.h>
#include
<zmapThreads_P.h>
...
...
@@ -220,7 +221,7 @@ void zMapThreadKill(ZMapThread thread)
{
int
status
;
ZMAPTHREAD_DEBUG
((
"GUI: killing and destroying thread for thread %
lu
\n
"
,
t
hread
->
thread
_id
))
;
ZMAPTHREAD_DEBUG
((
"GUI: killing and destroying thread for thread %
s
\n
"
,
zMapThreadGetT
hread
ID
(
thread
)
))
;
/* we could signal an exit here by setting a condvar of EXIT...but that might lead to
* deadlocks, think about this bit.. */
...
...
@@ -238,7 +239,7 @@ void zMapThreadKill(ZMapThread thread)
/* Release the threads resources, don't do this until the slave thread has gone. */
void
zMapThreadDestroy
(
ZMapThread
thread
)
{
ZMAPTHREAD_DEBUG
((
"GUI: destroying thread for thread %
lu
\n
"
,
t
hread
->
thread
_id
))
;
ZMAPTHREAD_DEBUG
((
"GUI: destroying thread for thread %
s
\n
"
,
zMapThreadGetT
hread
ID
(
thread
)
))
;
zmapVarDestroy
(
&
thread
->
reply
)
;
zmapCondVarDestroy
(
&
(
thread
->
request
))
;
...
...
This diff is collapsed.
Click to expand it.
src/zmapThreads/zmapThreadsUtils.c
+
3
−
2
View file @
e37c97a8
...
...
@@ -26,12 +26,13 @@
*
* Exported functions: See ZMap/zmapThreads.h
* HISTORY:
* Last edited: Feb
1 09:57
200
5
(edgrif)
* Last edited: Feb
21 15:15
200
7
(edgrif)
* Created: Thu Jan 27 11:50:01 2005 (edgrif)
* CVS info: $Id: zmapThreadsUtils.c,v 1.
2
200
6-11
-0
8
09:
24:3
6 edgrif Exp $
* CVS info: $Id: zmapThreadsUtils.c,v 1.
3
200
7-03
-0
1
09:
15:5
6 edgrif Exp $
*-------------------------------------------------------------------
*/
#include
<stdio.h>
#include
<errno.h>
#include
<ZMap/zmapUtils.h>
#include
<zmapThreads_P.h>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment