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
0cd9f3ff
Commit
0cd9f3ff
authored
21 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
sort out passing in new data for request. sort out debugging messages.
parent
cf0eacdf
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/zmapConn.c
+12
-14
12 additions, 14 deletions
src/zmapThreads/zmapConn.c
with
12 additions
and
14 deletions
src/zmapThreads/zmapConn.c
+
12
−
14
View file @
0cd9f3ff
...
...
@@ -26,13 +26,14 @@
* Description:
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Mar
2 1
0
:3
9
2004 (edgrif)
* Last edited: Mar
1
2 1
4
:3
0
2004 (edgrif)
* Created: Thu Jul 24 14:37:18 2003 (edgrif)
* CVS info: $Id: zmapConn.c,v 1.
3
2004-03-
03 12:04:18
edgrif Exp $
* CVS info: $Id: zmapConn.c,v 1.
4
2004-03-
12 15:57:00
edgrif Exp $
*-------------------------------------------------------------------
*/
#include
<string.h>
#include
<ZMap/zmapUtils.h>
#include
<zmapConn_P.h>
/* Turn on/off all debugging messages for threads. */
...
...
@@ -55,27 +56,28 @@ ZMapConnection zMapConnCreate(char *machine, char *port, char *protocol, char *s
/* ok to just set state here because we have not started the thread yet.... */
zmapCondVarCreate
(
&
(
connection
->
request
))
;
connection
->
request
.
state
=
ZMAP_REQUEST_WAIT
;
connection
->
request
.
state
=
NULL
;
zmapVarCreate
(
&
(
connection
->
reply
))
;
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
connection
->
reply
.
state
=
ZMAP_REPLY_INIT
;
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
connection
->
reply
.
state
=
ZMAP_REPLY_WAIT
;
connection
->
reply
.
data
=
NULL
;
connection
->
reply
.
error_msg
=
NULL
;
/* Set the new threads attributes so it will run "detached", we do not want anything from them.
* when they die, we want them to go away and release their resources. */
if
(
status
==
0
&&
(
status
=
pthread_attr_init
(
&
thread_attr
))
!=
0
)
{
ZMAPSYSERR
(
status
,
"Create thread attibutes"
)
;
ZMAP
FATAL
SYSERR
(
status
,
"%s"
,
"Create thread attibutes"
)
;
}
if
(
status
==
0
&&
(
status
=
pthread_attr_setdetachstate
(
&
thread_attr
,
PTHREAD_CREATE_DETACHED
))
!=
0
)
{
ZMAPSYSERR
(
status
,
"Set thread detached attibute"
)
;
ZMAP
FATAL
SYSERR
(
status
,
"%s"
,
"Set thread detached attibute"
)
;
}
...
...
@@ -83,7 +85,7 @@ ZMapConnection zMapConnCreate(char *machine, char *port, char *protocol, char *s
if
(
status
==
0
&&
(
status
=
pthread_create
(
&
thread_id
,
&
thread_attr
,
zmapNewThread
,
(
void
*
)
connection
))
!=
0
)
{
ZMAPSYSERR
(
status
,
"Thread creation"
)
;
ZMAP
FATAL
SYSERR
(
status
,
"%s"
,
"Thread creation"
)
;
}
if
(
status
==
0
)
...
...
@@ -101,9 +103,9 @@ ZMapConnection zMapConnCreate(char *machine, char *port, char *protocol, char *s
void
zMapConnLoadData
(
ZMapConnection
connection
)
void
zMapConnLoadData
(
ZMapConnection
connection
,
gchar
*
data
)
{
zmapCondVarSignal
(
&
connection
->
request
,
ZMAP_REQUEST_GETDATA
)
;
zmapCondVarSignal
(
&
connection
->
request
,
ZMAP_REQUEST_GETDATA
,
data
)
;
return
;
}
...
...
@@ -181,7 +183,7 @@ void zMapConnKill(ZMapConnection connection)
/* Signal the thread to cancel it */
if
((
status
=
pthread_cancel
(
connection
->
thread_id
))
!=
0
)
{
ZMAPSYSERR
(
status
,
"Thread cancel"
)
;
ZMAP
FATAL
SYSERR
(
status
,
"%s"
,
"Thread cancel"
)
;
}
return
;
...
...
@@ -199,7 +201,6 @@ void zMapConnDestroy(ZMapConnection connection)
zmapCondVarDestroy
(
&
(
connection
->
request
))
;
g_free
(
connection
->
machine
)
;
g_free
(
connection
->
sequence
)
;
g_free
(
connection
)
;
...
...
@@ -224,7 +225,6 @@ static ZMapConnection createConnection(char *machine, char *port, char *protocol
connection
->
machine
=
g_strdup
(
machine
)
;
connection
->
port
=
atoi
(
port
)
;
connection
->
protocol
=
g_strdup
(
protocol
)
;
connection
->
sequence
=
g_strdup
(
sequence
)
;
return
connection
;
}
...
...
@@ -236,8 +236,6 @@ static void destroyConnection(ZMapConnection connection)
{
g_free
(
connection
->
machine
)
;
g_free
(
connection
->
protocol
)
;
g_free
(
connection
->
sequence
)
;
/* Setting this to zero prevents subtle bugs where calling code continues
* to try to reuse a defunct control block. */
...
...
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