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
3e4d0270
Commit
3e4d0270
authored
20 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
internal header for new threads package.
parent
51b114a1
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/zmapThreads_P.h
+120
-0
120 additions, 0 deletions
src/zmapThreads/zmapThreads_P.h
with
120 additions
and
0 deletions
src/zmapThreads/zmapThreads_P.h
0 → 100755
+
120
−
0
View file @
3e4d0270
/* File: zmapThreads_P.h
* Author: Ed Griffiths (edgrif@sanger.ac.uk)
* Copyright (c) Sanger Institute, 2005
*-------------------------------------------------------------------
* ZMap is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see the on-line version at http://www.gnu.org/copyleft/gpl.txt
*-------------------------------------------------------------------
* This file is part of the ZMap genome database package
* originated by
* Ed Griffiths (Sanger Institute, UK) edgrif@sanger.ac.uk,
* Rob Clack (Sanger Institute, UK) rnc@sanger.ac.uk
*
* Description: Internals for the thread control code.
*
* HISTORY:
* Last edited: Jan 27 14:17 2005 (edgrif)
* Created: Thu Jan 27 11:18:44 2005 (edgrif)
* CVS info: $Id: zmapThreads_P.h,v 1.1 2005-02-02 15:15:52 edgrif Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_THREAD_PRIV_H
#define ZMAP_THREAD_PRIV_H
#include
<pthread.h>
#include
<glib.h>
#include
<ZMap/zmapSys.h>
#include
<ZMap/zmapThreads.h>
/* Seems that Linux defines the time structure used in some pthread calls as "timespec",
* whereas alphas call it "timespec_t"....deep sigh.... */
#ifdef LINUX
#define TIMESPEC struct timespec
#else
#define TIMESPEC timespec_t
#endif
#define ZMAPTHREAD_DEBUG(ALL_ARGS_WITH_BRACKETS) \
do { \
if (zmap_thread_debug_G) \
printf ALL_ARGS_WITH_BRACKETS ; \
} while (0)
/* Requests are via a cond var system. */
typedef
struct
{
pthread_mutex_t
mutex
;
/* controls access to this struct. */
pthread_cond_t
cond
;
/* Slave waits on this. */
ZMapThreadRequest
state
;
/* Thread request to slave. */
void
*
request
;
/* Actual request from caller. */
}
ZMapRequestStruct
,
*
ZMapRequest
;
/* Replies via a simpler mutex. */
typedef
struct
{
pthread_mutex_t
mutex
;
/* controls access to this struct. */
ZMapThreadReply
state
;
/* Thread reply from slave. */
void
*
reply
;
/* Actual reply from callee. */
gchar
*
error_msg
;
/* Error message for when thread fails. */
}
ZMapReplyStruct
,
*
ZMapReply
;
/* The ZMapThread, this structure represents a slave thread. */
typedef
struct
_ZMapThreadStruct
{
pthread_t
thread_id
;
/* These control the communication between the GUI thread and the thread threads,
* they are mutex locked and the request code makes use of the condition variable to
* communicate with slave threads. */
ZMapRequestStruct
request
;
/* GUIs request. */
ZMapReplyStruct
reply
;
/* Slaves reply. */
/* User registered routine to which the thread calls to handle requests and replies. */
ZMapThreadRequestHandlerFunc
handler_func
;
}
ZMapThreadStruct
;
/* Thread calls. */
void
*
zmapNewThread
(
void
*
thread_args
)
;
/* Request routines. */
void
zmapCondVarCreate
(
ZMapRequest
thread_state
)
;
void
zmapCondVarSignal
(
ZMapRequest
thread_state
,
ZMapThreadRequest
new_state
,
void
*
request
)
;
void
zmapCondVarWait
(
ZMapRequest
thread_state
,
ZMapThreadRequest
waiting_state
)
;
ZMapThreadRequest
zmapCondVarWaitTimed
(
ZMapRequest
condvar
,
ZMapThreadRequest
waiting_state
,
TIMESPEC
*
timeout
,
gboolean
reset_to_waiting
,
void
**
data
)
;
void
zmapCondVarDestroy
(
ZMapRequest
thread_state
)
;
/* Reply routines. */
void
zmapVarCreate
(
ZMapReply
thread_state
)
;
void
zmapVarSetValue
(
ZMapReply
thread_state
,
ZMapThreadReply
new_state
)
;
gboolean
zmapVarGetValue
(
ZMapReply
thread_state
,
ZMapThreadReply
*
state_out
)
;
void
zmapVarSetValueWithData
(
ZMapReply
thread_state
,
ZMapThreadReply
new_state
,
void
*
data
)
;
void
zmapVarSetValueWithError
(
ZMapReply
thread_state
,
ZMapThreadReply
new_state
,
char
*
err_msg
)
;
gboolean
zmapVarGetValueWithData
(
ZMapReply
thread_state
,
ZMapThreadReply
*
state_out
,
void
**
data_out
,
char
**
err_msg_out
)
;
void
zmapVarDestroy
(
ZMapReply
thread_state
)
;
#endif
/* !ZMAP_THREAD_PRIV_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