Permalink
Browse files

use inline

  • Loading branch information...
1 parent 7d9348b commit 167d15d9a013e415749e7755660ebe89176317e6 @xk committed Mar 25, 2012
Showing with 14 additions and 14 deletions.
  1. +8 −8 src/queues_a_gogo.cc
  2. +6 −6 src/threads_a_gogo.cc
View
@@ -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);
@@ -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);
@@ -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) {
@@ -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);
View
@@ -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);
@@ -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)));
@@ -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()) {
@@ -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) {

0 comments on commit 167d15d

Please sign in to comment.