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
61e07188
Commit
61e07188
authored
21 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
Add data passing to condvar request call. Make sure we always pass back error messages..
parent
c80be97a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/zmapThreads/zmapSlave.c
+36
-5
36 additions, 5 deletions
src/zmapThreads/zmapSlave.c
with
36 additions
and
5 deletions
src/zmapThreads/zmapSlave.c
+
36
−
5
View file @
61e07188
...
...
@@ -26,9 +26,9 @@
* Description:
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Mar
1 1
9
:5
2
2004 (edgrif)
* Last edited: Mar
1
1 1
5
:5
6
2004 (edgrif)
* Created: Thu Jul 24 14:37:26 2003 (edgrif)
* CVS info: $Id: zmapSlave.c,v 1.
2
2004-03-
03 12:07:35
edgrif Exp $
* CVS info: $Id: zmapSlave.c,v 1.
3
2004-03-
12 15:59:27
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -115,12 +115,16 @@ void *zmapNewThread(void *thread_args)
while
(
1
)
{
gchar
*
sequence
;
ZMAP_THR_DEBUG
((
"%x: about to do timed wait
\n
"
,
connection
->
thread_id
))
;
/* this will crap over performance...asking the time all the time !! */
timeout
.
tv_sec
=
5
;
/* n.b. interface seems to absolute time. */
timeout
.
tv_nsec
=
0
;
signalled_state
=
zmapCondVarWaitTimed
(
thread_state
,
ZMAP_REQUEST_WAIT
,
&
timeout
,
TRUE
)
;
sequence
=
NULL
;
signalled_state
=
zmapCondVarWaitTimed
(
thread_state
,
ZMAP_REQUEST_WAIT
,
&
timeout
,
TRUE
,
&
sequence
)
;
ZMAP_THR_DEBUG
((
"%x: finished condvar wait, state = %s
\n
"
,
connection
->
thread_id
,
zMapVarGetRequestString
(
signalled_state
)))
;
...
...
@@ -134,16 +138,23 @@ void *zmapNewThread(void *thread_args)
static
int
failure
=
0
;
char
*
server_command
;
ZMAP_THR_DEBUG
((
"%x: getting data....
\n
"
,
connection
->
thread_id
))
;
/* Is it an error to not have a sequence ????? */
if
(
!
sequence
)
sequence
=
""
;
ZMAP_THR_DEBUG
((
"%x: getting sequence %s....
\n
"
,
connection
->
thread_id
,
sequence
))
;
g_string_sprintf
(
thread_cb
->
server_request
,
"gif seqget %s ; seqfeatures"
,
connection
->
sequence
)
;
"gif seqget %s ; seqfeatures"
,
sequence
)
;
if
(
!
zMapServerRequest
(
thread_cb
->
server
,
thread_cb
->
server_request
->
str
,
&
(
thread_cb
->
server_reply
)))
{
thread_cb
->
thread_died
=
TRUE
;
thread_cb
->
initial_error
=
g_strdup_printf
(
"%s - %s"
,
ZMAPSLAVE_CONNREQUEST
,
zMapServerLastErrorMsg
(
thread_cb
->
server
))
;
/* NOTE IMPLICIT TERMINATION OF THREAD BY JUMPING OUT OF THIS LOOP
* WHICH LEADS TO EXITTING FROM THIS ROUTINE. FOR OTHER ERRORS WE WIL
* HAVE TO HAVE A MORE FORMAL MECHANISM.... */
...
...
@@ -159,6 +170,18 @@ void *zmapNewThread(void *thread_args)
thread_cb
->
server_reply
=
NULL
;
/* Reset, we don't free this string. */
}
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
else
{
/* unknown state......... */
thread_cb
->
thread_died
=
TRUE
;
thread_cb
->
initial_error
=
g_strdup_printf
(
"Thread received unknown state from GUI: %s"
,
zMapVarGetRequestString
(
signalled_state
))
;
goto
clean_up
;
}
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
}
...
...
@@ -230,11 +253,19 @@ static void cleanUpThread(void *thread_args)
g_free
(
thread_cb
)
;
printf
(
"%x: error msg before condvar set: %s
\n
"
,
connection
->
thread_id
,
error_msg
)
;
fflush
(
stdout
)
;
if
(
!
error_msg
)
zmapVarSetValue
(
&
(
connection
->
reply
),
reply
)
;
else
zmapVarSetValueWithError
(
&
(
connection
->
reply
),
reply
,
error_msg
)
;
printf
(
"%x: error msg after condvar set: %s
\n
"
,
connection
->
thread_id
,
error_msg
)
;
fflush
(
stdout
)
;
ZMAP_THR_DEBUG
((
"%x: thread clean-up routine exitting because %s....
\n
"
,
connection
->
thread_id
,
...
...
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