summaryrefslogtreecommitdiff
path: root/gtk2_ardour/gprofhelper.c
diff options
context:
space:
mode:
authorThomas Brand <tom@trellis.ch>2017-07-01 18:42:24 +0200
committerRobin Gareus <robin@gareus.org>2017-07-01 19:28:26 +0200
commit63ea7b6516dbd7554d1eff6c98de50cf61fc9a72 (patch)
tree82fa339e009bc082dd8023916990800bea437081 /gtk2_ardour/gprofhelper.c
parentf413b83cb9fa50954969a3d849999e1890ce6690 (diff)
NO-OP whitespace (updated GH PR #357)
Diffstat (limited to 'gtk2_ardour/gprofhelper.c')
-rw-r--r--gtk2_ardour/gprofhelper.c102
1 files changed, 51 insertions, 51 deletions
diff --git a/gtk2_ardour/gprofhelper.c b/gtk2_ardour/gprofhelper.c
index b806a073c6..2732f76033 100644
--- a/gtk2_ardour/gprofhelper.c
+++ b/gtk2_ardour/gprofhelper.c
@@ -33,50 +33,50 @@ static int (*pthread_create_orig)(pthread_t *__restrict,
/* Library initialization function */
void _init(void)
{
- pthread_create_orig = dlsym(RTLD_NEXT, "pthread_create");
- fprintf(stderr, "pthreads: using profiling hooks for gprof\n");
- if(pthread_create_orig == NULL)
- {
- char *error = dlerror();
- if(error == NULL)
- {
- error = "pthread_create is NULL";
- }
- fprintf(stderr, "%s", error);
- exit(EXIT_FAILURE);
- }
+ pthread_create_orig = dlsym(RTLD_NEXT, "pthread_create");
+ fprintf(stderr, "pthreads: using profiling hooks for gprof\n");
+ if(pthread_create_orig == NULL)
+ {
+ char *error = dlerror();
+ if(error == NULL)
+ {
+ error = "pthread_create is NULL";
+ }
+ fprintf(stderr, "%s", error);
+ exit(EXIT_FAILURE);
+ }
}
/* Our data structure passed to the wrapper */
typedef struct wrapper_s
{
- void * (*start_routine)(void *);
- void * arg;
+ void * (*start_routine)(void *);
+ void * arg;
- pthread_mutex_t lock;
- pthread_cond_t wait;
+ pthread_mutex_t lock;
+ pthread_cond_t wait;
- struct itimerval itimer;
+ struct itimerval itimer;
} wrapper_t;
/* The wrapper function in charge for setting the itimer value */
static void * wrapper_routine(void * data)
{
- /* Put user data in thread-local variables */
- void * (*start_routine)(void *) = ((wrapper_t*)data)->start_routine;
- void * arg = ((wrapper_t*)data)->arg;
+ /* Put user data in thread-local variables */
+ void * (*start_routine)(void *) = ((wrapper_t*)data)->start_routine;
+ void * arg = ((wrapper_t*)data)->arg;
- /* Set the profile timer value */
- setitimer(ITIMER_PROF, &((wrapper_t*)data)->itimer, NULL);
+ /* Set the profile timer value */
+ setitimer(ITIMER_PROF, &((wrapper_t*)data)->itimer, NULL);
- /* Tell the calling thread that we don't need its data anymore */
- pthread_mutex_lock(&((wrapper_t*)data)->lock);
- pthread_cond_signal(&((wrapper_t*)data)->wait);
- pthread_mutex_unlock(&((wrapper_t*)data)->lock);
+ /* Tell the calling thread that we don't need its data anymore */
+ pthread_mutex_lock(&((wrapper_t*)data)->lock);
+ pthread_cond_signal(&((wrapper_t*)data)->wait);
+ pthread_mutex_unlock(&((wrapper_t*)data)->lock);
- /* Call the real function */
- return start_routine(arg);
+ /* Call the real function */
+ return start_routine(arg);
}
/* Our wrapper function for the real pthread_create() */
@@ -85,33 +85,33 @@ int pthread_create(pthread_t *__restrict thread,
void * (*start_routine)(void *),
void *__restrict arg)
{
- wrapper_t wrapper_data;
- int i_return;
-
- /* Initialize the wrapper structure */
- wrapper_data.start_routine = start_routine;
- wrapper_data.arg = arg;
- getitimer(ITIMER_PROF, &wrapper_data.itimer);
- pthread_cond_init(&wrapper_data.wait, NULL);
- pthread_mutex_init(&wrapper_data.lock, NULL);
- pthread_mutex_lock(&wrapper_data.lock);
-
- /* The real pthread_create call */
- i_return = pthread_create_orig(thread,
+ wrapper_t wrapper_data;
+ int i_return;
+
+ /* Initialize the wrapper structure */
+ wrapper_data.start_routine = start_routine;
+ wrapper_data.arg = arg;
+ getitimer(ITIMER_PROF, &wrapper_data.itimer);
+ pthread_cond_init(&wrapper_data.wait, NULL);
+ pthread_mutex_init(&wrapper_data.lock, NULL);
+ pthread_mutex_lock(&wrapper_data.lock);
+
+ /* The real pthread_create call */
+ i_return = pthread_create_orig(thread,
attr,
&wrapper_routine,
&wrapper_data);
- /* If the thread was successfully spawned, wait for the data
- * to be released */
- if(i_return == 0)
- {
- pthread_cond_wait(&wrapper_data.wait, &wrapper_data.lock);
- }
+ /* If the thread was successfully spawned, wait for the data
+ * to be released */
+ if(i_return == 0)
+ {
+ pthread_cond_wait(&wrapper_data.wait, &wrapper_data.lock);
+ }
- pthread_mutex_unlock(&wrapper_data.lock);
- pthread_mutex_destroy(&wrapper_data.lock);
- pthread_cond_destroy(&wrapper_data.wait);
+ pthread_mutex_unlock(&wrapper_data.lock);
+ pthread_mutex_destroy(&wrapper_data.lock);
+ pthread_cond_destroy(&wrapper_data.wait);
- return i_return;
+ return i_return;
}