A brief file description. More...
#include "ink_hrtime.h"
#include "ink_defs.h"
#include <sched.h>
#include <pthread.h>
#include <signal.h>
#include <semaphore.h>
#include "ink_mutex.h"
#include <errno.h>
#include "ink_assert.h"
Go to the source code of this file.
Data Structures | |
struct | ink_semaphore |
Defines | |
#define | INK_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER |
Typedefs | |
typedef pthread_t | ink_thread |
typedef pthread_cond_t | ink_cond |
typedef pthread_key_t | ink_thread_key |
typedef struct timespec | ink_timestruc |
Functions | |
static void | ink_thread_key_create (ink_thread_key *key, void(*destructor)(void *value)) |
static void | ink_thread_setspecific (ink_thread_key key, void *value) |
static void * | ink_thread_getspecific (ink_thread_key key) |
static void | ink_thread_key_delete (ink_thread_key key) |
static ink_thread | ink_thread_create (void *(*f)(void *), void *a, int detached=0, size_t stacksize=0) |
static void | ink_thread_cancel (ink_thread who) |
static void * | ink_thread_join (ink_thread t) |
static ink_thread | ink_thread_self () |
static int | ink_thread_get_priority (ink_thread t, int *priority) |
static int | ink_thread_sigsetmask (int how, const sigset_t *set, sigset_t *oset) |
void | ink_sem_init (ink_semaphore *sp, unsigned int count) |
void | ink_sem_destroy (ink_semaphore *sp) |
void | ink_sem_wait (ink_semaphore *sp) |
bool | ink_sem_trywait (ink_semaphore *sp) |
void | ink_sem_post (ink_semaphore *sp) |
static void | ink_cond_init (ink_cond *cp) |
static void | ink_cond_destroy (ink_cond *cp) |
static void | ink_cond_wait (ink_cond *cp, ink_mutex *mp) |
static int | ink_cond_timedwait (ink_cond *cp, ink_mutex *mp, ink_timestruc *t) |
static void | ink_cond_signal (ink_cond *cp) |
static void | ink_cond_broadcast (ink_cond *cp) |
static void | ink_thr_yield () |
static void | ink_thread_exit (void *status) |
static void | ink_set_thread_name (const char *name ATS_UNUSED) |
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file ink_thread.h.
#define INK_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER |
Definition at line 53 of file ink_thread.h.
typedef pthread_cond_t ink_cond |
Definition at line 56 of file ink_thread.h.
typedef pthread_t ink_thread |
Definition at line 55 of file ink_thread.h.
typedef pthread_key_t ink_thread_key |
Definition at line 57 of file ink_thread.h.
typedef struct timespec ink_timestruc |
Definition at line 89 of file ink_thread.h.
static void ink_cond_broadcast | ( | ink_cond * | cp | ) | [inline, static] |
Definition at line 259 of file ink_thread.h.
References ink_assert.
Referenced by ink_rwlock_unlock().
static void ink_cond_destroy | ( | ink_cond * | cp | ) | [inline, static] |
Definition at line 229 of file ink_thread.h.
References ink_assert.
Referenced by ink_rwlock_destroy(), and EventNotify::~EventNotify().
static void ink_cond_init | ( | ink_cond * | cp | ) | [inline, static] |
Definition at line 223 of file ink_thread.h.
References ink_assert.
Referenced by aio_init_fildes(), EventNotify::EventNotify(), ink_rwlock_init(), and ProtectedQueue::ProtectedQueue().
static void ink_cond_signal | ( | ink_cond * | cp | ) | [inline, static] |
Definition at line 253 of file ink_thread.h.
References ink_assert.
Referenced by aio_queue_req(), ink_rwlock_unlock(), ProtectedQueue::signal(), EventNotify::signal(), and ProtectedQueue::try_signal().
static int ink_cond_timedwait | ( | ink_cond * | cp, | |
ink_mutex * | mp, | |||
ink_timestruc * | t | |||
) | [inline, static] |
Definition at line 240 of file ink_thread.h.
References ink_assert.
Referenced by aio_thread_main(), ProtectedQueue::dequeue_timed(), and EventNotify::timedwait().
Definition at line 235 of file ink_thread.h.
References ink_assert.
Referenced by ink_rwlock_rdlock(), ink_rwlock_wrlock(), and EventNotify::wait().
void ink_sem_destroy | ( | ink_semaphore * | sp | ) |
Definition at line 66 of file ink_thread.cc.
References ink_semaphore::get(), and ink_assert.
Referenced by delete_queue().
void ink_sem_init | ( | ink_semaphore * | sp, | |
unsigned int | count | |||
) |
Definition at line 46 of file ink_thread.cc.
References ink_semaphore::get(), ink_assert, and ink_semaphore::sema.
Referenced by create_queue().
void ink_sem_post | ( | ink_semaphore * | sp | ) |
Definition at line 93 of file ink_thread.cc.
References ink_semaphore::get(), and ink_assert.
Referenced by enqueue().
bool ink_sem_trywait | ( | ink_semaphore * | sp | ) |
Definition at line 84 of file ink_thread.cc.
References ink_semaphore::get(), and ink_assert.
void ink_sem_wait | ( | ink_semaphore * | sp | ) |
Definition at line 76 of file ink_thread.cc.
References ink_semaphore::get(), and ink_assert.
Referenced by dequeue().
static void ink_set_thread_name | ( | const char *name | ATS_UNUSED | ) | [inline, static] |
Definition at line 280 of file ink_thread.h.
Referenced by main(), and spawn_thread_internal().
static void ink_thr_yield | ( | ) | [inline, static] |
Definition at line 265 of file ink_thread.h.
References ink_assert.
static void ink_thread_cancel | ( | ink_thread | who | ) | [inline, static] |
Definition at line 160 of file ink_thread.h.
References ink_assert.
static ink_thread ink_thread_create | ( | void *(*)(void *) | f, | |
void * | a, | |||
int | detached = 0 , |
|||
size_t | stacksize = 0 | |||
) | [inline, static] |
Fix for INKqa10118. If the thread has not been created successfully return 0.
Definition at line 131 of file ink_thread.h.
References ink_assert.
Referenced by init_signals(), RecLocalStart(), Thread::start(), and TSThreadCreate().
static void ink_thread_exit | ( | void * | status | ) | [inline, static] |
Definition at line 271 of file ink_thread.h.
Referenced by ThreadFatalClass::raise().
static int ink_thread_get_priority | ( | ink_thread | t, | |
int * | priority | |||
) | [inline, static] |
Definition at line 186 of file ink_thread.h.
References ink_assert.
static void* ink_thread_getspecific | ( | ink_thread_key | key | ) | [inline, static] |
Definition at line 118 of file ink_thread.h.
Referenced by this_thread().
static void* ink_thread_join | ( | ink_thread | t | ) | [inline, static] |
Definition at line 172 of file ink_thread.h.
References ink_assert.
static void ink_thread_key_create | ( | ink_thread_key * | key, | |
void(*)(void *value) | destructor | |||
) | [inline, static] |
Definition at line 106 of file ink_thread.h.
References ink_assert.
Referenced by init_thread_key().
static void ink_thread_key_delete | ( | ink_thread_key | key | ) | [inline, static] |
Definition at line 124 of file ink_thread.h.
References ink_assert.
static ink_thread ink_thread_self | ( | ) | [inline, static] |
Definition at line 180 of file ink_thread.h.
Referenced by rec_mutex_acquire().
static void ink_thread_setspecific | ( | ink_thread_key | key, | |
void * | value | |||
) | [inline, static] |
Definition at line 112 of file ink_thread.h.
References ink_assert.
Referenced by Thread::set_specific(), and EventProcessor::start().
static int ink_thread_sigsetmask | ( | int | how, | |
const sigset_t * | set, | |||
sigset_t * | oset | |||
) | [inline, static] |
Definition at line 203 of file ink_thread.h.
Referenced by init_signals().