Skip to content

Commit

Permalink
use inline
Browse files Browse the repository at this point in the history
  • Loading branch information
xk committed Mar 25, 2012
1 parent 7d9348b commit 167d15d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/queues_a_gogo.cc
Expand Up @@ -38,18 +38,18 @@ static typeQueue* freeItemsQueue= NULL;



static void queue_push (typeQueueItem* qitem, typeQueue* queue);
static typeQueueItem* queue_pull (typeQueue* queue);
static typeQueueItem* nuItem (int itemType, void* item);
static void destroyItem (typeQueueItem* qitem);
static inline void queue_push (typeQueueItem* qitem, typeQueue* queue);
static inline typeQueueItem* queue_pull (typeQueue* queue);
static inline typeQueueItem* nuItem (int itemType, void* item);
static inline void destroyItem (typeQueueItem* qitem);
static typeQueue* nuQueue (long int id);
static void resetQueue (typeQueue* queue);
static void initQueues (void);




static void queue_push (typeQueueItem* qitem, typeQueue* queue) {
static inline void queue_push (typeQueueItem* qitem, typeQueue* queue) {
qitem->next= NULL;

pthread_mutex_lock(&queue->queueLock);
Expand All @@ -67,7 +67,7 @@ static void queue_push (typeQueueItem* qitem, typeQueue* queue) {



static typeQueueItem* queue_pull (typeQueue* queue) {
static inline typeQueueItem* queue_pull (typeQueue* queue) {
typeQueueItem* qitem;

pthread_mutex_lock(&queue->queueLock);
Expand All @@ -89,7 +89,7 @@ static typeQueueItem* queue_pull (typeQueue* queue) {



static typeQueueItem* nuItem (int itemType, void* item) {
static inline typeQueueItem* nuItem (int itemType, void* item) {

typeQueueItem* qitem= queue_pull(freeItemsQueue);
if (!qitem) {
Expand All @@ -111,7 +111,7 @@ static typeQueueItem* nuItem (int itemType, void* item) {



static void destroyItem (typeQueueItem* qitem) {
static inline void destroyItem (typeQueueItem* qitem) {

if (freeItemsQueue) {
queue_push(qitem, freeItemsQueue);
Expand Down
12 changes: 6 additions & 6 deletions src/threads_a_gogo.cc
Expand Up @@ -111,9 +111,9 @@ cat ../../../src/thread_nextTick.js | ./minify kThread_nextTick_js > ../../../sr
//node-waf configure uninstall distclean configure build install


static typeQueueItem* nuJobQueueItem (void);
static typeThread* isAThread (Handle<Object> receiver);
static void pushToInQueue (typeQueueItem* qitem, typeThread* thread);
static inline typeQueueItem* nuJobQueueItem (void);
static inline typeThread* isAThread (Handle<Object> receiver);
static inline void pushToInQueue (typeQueueItem* qitem, typeThread* thread);
static Handle<Value> Puts (const Arguments &args);
static void* aThread (void* arg);
static void eventLoop (typeThread* thread);
Expand All @@ -133,7 +133,7 @@ void Init (Handle<Object> target);



static typeQueueItem* nuJobQueueItem (void) {
static inline typeQueueItem* nuJobQueueItem (void) {
typeQueueItem* qitem= queue_pull(freeJobsQueue);
if (!qitem) {
qitem= nuItem(kItemTypePointer, calloc(1, sizeof(typeJob)));
Expand All @@ -146,7 +146,7 @@ static typeQueueItem* nuJobQueueItem (void) {



static typeThread* isAThread (Handle<Object> receiver) {
static inline typeThread* isAThread (Handle<Object> receiver) {
typeThread* thread;

if (receiver->IsObject()) {
Expand All @@ -166,7 +166,7 @@ static typeThread* isAThread (Handle<Object> receiver) {



static void pushToInQueue (typeQueueItem* qitem, typeThread* thread) {
static inline void pushToInQueue (typeQueueItem* qitem, typeThread* thread) {
pthread_mutex_lock(&thread->IDLE_mutex);
queue_push(qitem, &thread->inQueue);
if (thread->IDLE) {
Expand Down

0 comments on commit 167d15d

Please sign in to comment.