Skip to content
Snippets Groups Projects
Commit 858e0444 authored by slevy's avatar slevy
Browse files

Use HAVE_PTHREAD_H -- conditionally have POSIX mutex.

parent ba634a87
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,8 @@
extern "C" {
#endif
#include "config.h"
#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
......@@ -31,7 +33,9 @@ extern "C" {
#include "textures.h"
#include "sclock.h"
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif /*HAVE_PTHREAD_H*/
#include <stdio.h>
......@@ -232,17 +236,15 @@ enum FadeType {
F_SPHERICAL, F_PLANAR, F_CONSTANT, F_LINEAR, F_LREGION, F_KNEE2, F_KNEE12
};
typedef struct threader {
struct threader *next;
char *name;
pthread_t thread;
int enabled;
struct stuff *st;
int (*notify)( struct threader *, struct stuff *, void * );
void *data;
} ThReader;
/* async reader ops:
* lock, unlock shared data (by reader and main)
* pause, resume thread (wait on condition variable) (by main)
* cancel read (by main)
* set memory budget (by main)
* notify of change of timespan or whatever (by reader)
* import data (by reader)
* purge data (by reader)
*/
typedef struct dyndata {
int enabled;
......@@ -269,8 +271,10 @@ struct stuff {
struct specklist *sl; /* Current display = anima[curdata][curtime] */
/* shared with possible reader threads: */
pthread_mutex_t smut;
struct specklist **anima[MAXFILES]; /* anima[ndata][ntimes]: All data. Shared with reader threads. */
#ifdef HAVE_PTHREAD_H
pthread_mutex_t smut;
#endif
char dataname[MAXFILES][12];
int ntimes, ndata;
......@@ -512,11 +516,13 @@ extern void specks_current_frame( struct stuff *, struct specklist *sl );
extern void specks_reupdate( struct stuff *, struct specklist *sl );
extern void specks_datawait( struct stuff * );
extern void specks_lock_init( struct stuff * );
extern void specks_lock( struct stuff * );
extern void specks_unlock( struct stuff * );
/* uses locking: */
extern struct specklist * specks_timespecks( struct stuff *, int dataset, int timestep );
extern void specks_ensuretime( struct stuff *, int dataset, int timestep );
extern void specks_insertspecks( struct stuff *, int dataset, int timestep, struct specklist * );
extern void specks_clearspecks( struct stuff *, int dataset, int timestep );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment