r3941 - in trunk: . beast-gtk bse bse/tests po sfi sfi/tests shell tests/bse



Author: timj
Date: 2006-10-07 14:50:38 -0400 (Sat, 07 Oct 2006)
New Revision: 3941

Modified:
   trunk/beast-gtk/bstmain.c
   trunk/beast-gtk/bstprofiler.c
   trunk/beast-gtk/bstusermessage.c
   trunk/beast-gtk/testgui.c
   trunk/bse/bsecore.cc
   trunk/bse/bseengine.c
   trunk/bse/bseenginemaster.c
   trunk/bse/bseenginenode.h
   trunk/bse/bseengineutils.c
   trunk/bse/bsemain.c
   trunk/bse/bsemain.h
   trunk/bse/bsemidireceiver.cc
   trunk/bse/bsepcmdevice-null.c
   trunk/bse/bsepcmdevice.c
   trunk/bse/bsepcmwriter.c
   trunk/bse/bseplugin.c
   trunk/bse/bsesequencer.cc
   trunk/bse/gslcommon.c
   trunk/bse/gslcommon.h
   trunk/bse/gsldatacache.c
   trunk/bse/gsldatahandle.c
   trunk/bse/gslfilehash.c
   trunk/bse/tests/blocktests.cc
   trunk/bse/tests/resamplehandle.cc
   trunk/configure.in
   trunk/po/POTFILES.in
   trunk/po/POTFILES.skip
   trunk/sfi/ChangeLog
   trunk/sfi/sficomport.c
   trunk/sfi/sficxx.cc
   trunk/sfi/sfiglue.c
   trunk/sfi/sfimemory.c
   trunk/sfi/sfimsg.c
   trunk/sfi/sfitypes.h
   trunk/sfi/sfiwrapper.cc
   trunk/sfi/sfiwrapper.h
   trunk/sfi/tests/misctests.c
   trunk/shell/bsescm.c
   trunk/tests/bse/cxxbinding.cc
Log:
Sat Oct  7 20:33:04 2006  Tim Janik  <timj gtk org>

        * sfiwrapper.cc, sfiwrapper.h: provide integer types.
        wrap cpu info and threading APIs. changed callers to use
        the wrapped SFI variants.

        * sfitypes.h: removed obsoleted cruft.

        * tests/misctests.c: added compilation test for all threading
        macros.




Modified: trunk/beast-gtk/bstmain.c
===================================================================
--- trunk/beast-gtk/bstmain.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/beast-gtk/bstmain.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -28,7 +28,6 @@
 #include "bstparam.h"
 #include "bstpreferences.h"
 #include "topconfig.h"
-#include "birnet/birnetcpu.h"
 #include "data/beast-images.h"
 #include <unistd.h>
 #include <string.h>
@@ -113,8 +112,8 @@
   sfi_init (&argc, &argv, _("BEAST"), NULL);  /* application name is user visible */       
   sfi_msg_allow ("misc");
   /* ensure SFI can wake us up */
-  birnet_thread_set_name ("Beast GUI");
-  birnet_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup,
+  sfi_thread_set_name ("Beast GUI");
+  sfi_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup,
 			 g_main_context_default (), NULL);
 
   /* initialize Gtk+ and go into threading mode */
@@ -721,8 +720,8 @@
   g_print ("\n");
   g_print ("Compiled for %s %s SSE plugins.\n", BST_ARCH_NAME, BSE_WITH_SSE_FLAGS ? "with" : "without");
   g_print ("Intrinsic code selected according to runtime CPU detection:\n");
-  const BirnetCPUInfo *cpu_info = birnet_cpu_info();
-  gchar *cpu_blurb = birnet_cpu_info_string (cpu_info);
+  const SfiCPUInfo cpu_info = sfi_cpu_info();
+  gchar *cpu_blurb = sfi_cpu_info_string (&cpu_info);
   g_print ("%s", cpu_blurb);
   g_free (cpu_blurb);
   g_print ("\n");

Modified: trunk/beast-gtk/bstprofiler.c
===================================================================
--- trunk/beast-gtk/bstprofiler.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/beast-gtk/bstprofiler.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -47,14 +47,14 @@
   switch (thread_state)
     {
     default:
-    case BSE_THREAD_STATE_UNKNOWN:      return BIRNET_THREAD_UNKNOWN;
-    case BSE_THREAD_STATE_RUNNING:      return BIRNET_THREAD_RUNNING;
-    case BSE_THREAD_STATE_SLEEPING:     return BIRNET_THREAD_SLEEPING;
-    case BSE_THREAD_STATE_DISKWAIT:     return BIRNET_THREAD_DISKWAIT;
-    case BSE_THREAD_STATE_TRACED:       return BIRNET_THREAD_TRACED;
-    case BSE_THREAD_STATE_PAGING:       return BIRNET_THREAD_PAGING;
-    case BSE_THREAD_STATE_ZOMBIE:       return BIRNET_THREAD_ZOMBIE;
-    case BSE_THREAD_STATE_DEAD:         return BIRNET_THREAD_DEAD;
+    case BSE_THREAD_STATE_UNKNOWN:      return SFI_THREAD_UNKNOWN;
+    case BSE_THREAD_STATE_RUNNING:      return SFI_THREAD_RUNNING;
+    case BSE_THREAD_STATE_SLEEPING:     return SFI_THREAD_SLEEPING;
+    case BSE_THREAD_STATE_DISKWAIT:     return SFI_THREAD_DISKWAIT;
+    case BSE_THREAD_STATE_TRACED:       return SFI_THREAD_TRACED;
+    case BSE_THREAD_STATE_PAGING:       return SFI_THREAD_PAGING;
+    case BSE_THREAD_STATE_ZOMBIE:       return SFI_THREAD_ZOMBIE;
+    case BSE_THREAD_STATE_DEAD:         return SFI_THREAD_DEAD;
     }
 }
 
@@ -64,14 +64,14 @@
   switch (thread_state)
     {
     default:
-    case BIRNET_THREAD_UNKNOWN:    return BSE_THREAD_STATE_UNKNOWN;
-    case BIRNET_THREAD_RUNNING:    return BSE_THREAD_STATE_RUNNING;
-    case BIRNET_THREAD_SLEEPING:   return BSE_THREAD_STATE_SLEEPING;
-    case BIRNET_THREAD_DISKWAIT:   return BSE_THREAD_STATE_DISKWAIT;
-    case BIRNET_THREAD_TRACED:     return BSE_THREAD_STATE_TRACED;
-    case BIRNET_THREAD_PAGING:     return BSE_THREAD_STATE_PAGING;
-    case BIRNET_THREAD_ZOMBIE:     return BSE_THREAD_STATE_ZOMBIE;
-    case BIRNET_THREAD_DEAD:       return BSE_THREAD_STATE_DEAD;
+    case SFI_THREAD_UNKNOWN:    return BSE_THREAD_STATE_UNKNOWN;
+    case SFI_THREAD_RUNNING:    return BSE_THREAD_STATE_RUNNING;
+    case SFI_THREAD_SLEEPING:   return BSE_THREAD_STATE_SLEEPING;
+    case SFI_THREAD_DISKWAIT:   return BSE_THREAD_STATE_DISKWAIT;
+    case SFI_THREAD_TRACED:     return BSE_THREAD_STATE_TRACED;
+    case SFI_THREAD_PAGING:     return BSE_THREAD_STATE_PAGING;
+    case SFI_THREAD_ZOMBIE:     return BSE_THREAD_STATE_ZOMBIE;
+    case SFI_THREAD_DEAD:       return BSE_THREAD_STATE_DEAD;
     }
 }
 
@@ -175,8 +175,8 @@
 {
   GxkListWrapper *lwrapper = g_object_get_data (profiler_dialog, "list-wrapper");
   BseThreadTotals *tt = bse_collect_thread_totals ();
-  birnet_thread_sleep (0); /* update accounting for self */
-  BirnetThreadInfo *si = birnet_thread_info_collect (birnet_thread_self());
+  sfi_thread_sleep (0); /* update accounting for self */
+  BirnetThreadInfo *si = sfi_thread_info_collect (sfi_thread_self());
   BseThreadInfo bi = { 0, };
   GSList *slist = NULL;
   guint i;
@@ -197,7 +197,7 @@
   slist = g_slist_prepend (slist, &bi);
   update_infos (slist, lwrapper);
   g_slist_free (slist);
-  birnet_thread_info_free (si);
+  sfi_thread_info_free (si);
 }
 
 static gboolean

Modified: trunk/beast-gtk/bstusermessage.c
===================================================================
--- trunk/beast-gtk/bstusermessage.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/beast-gtk/bstusermessage.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -656,8 +656,8 @@
   msg.secondary = lmsg->secondary;
   msg.details = lmsg->details;
   msg.janitor = bse_script_janitor();
-  msg.process = (char*) birnet_thread_get_name (NULL);
-  msg.pid = birnet_thread_get_pid (NULL);
+  msg.process = (char*) sfi_thread_get_name (NULL);
+  msg.pid = sfi_thread_get_pid (NULL);
   msg.n_msg_bits = lmsg->n_msg_bits;
   msg.msg_bits = lmsg->msg_bits;
   bst_message_handler (&msg);

Modified: trunk/beast-gtk/testgui.c
===================================================================
--- trunk/beast-gtk/testgui.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/beast-gtk/testgui.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -99,11 +99,11 @@
   g_type_init ();
 
   /* initialize Sfi */
-  birnet_init (&argc, &argv, "TestGUI");
+  sfi_init (&argc, &argv, "TestGUI", NULL);
   sfi_msg_allow ("misc");
   /* ensure SFI can wake us up */
-  birnet_thread_set_name ("TestGUI");
-  birnet_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup, g_main_context_default (), NULL);
+  sfi_thread_set_name ("TestGUI");
+  sfi_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup, g_main_context_default (), NULL);
 
   /* initialize Gtk+ and enter threading mode */
   gtk_init (&argc, &argv);

Modified: trunk/bse/bsecore.cc
===================================================================
--- trunk/bse/bsecore.cc	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bsecore.cc	2006-10-07 18:50:38 UTC (rev 3941)
@@ -35,14 +35,14 @@
       switch (ts)
         {
         default:
-        case BIRNET_THREAD_UNKNOWN:        return THREAD_STATE_UNKNOWN;
-        case BIRNET_THREAD_RUNNING:        return THREAD_STATE_RUNNING;
-        case BIRNET_THREAD_SLEEPING:       return THREAD_STATE_SLEEPING;
-        case BIRNET_THREAD_DISKWAIT:       return THREAD_STATE_DISKWAIT;
-        case BIRNET_THREAD_TRACED:         return THREAD_STATE_TRACED;
-        case BIRNET_THREAD_PAGING:         return THREAD_STATE_PAGING;
-        case BIRNET_THREAD_ZOMBIE:         return THREAD_STATE_ZOMBIE;
-        case BIRNET_THREAD_DEAD:           return THREAD_STATE_DEAD;
+        case BIRNET_THREAD_UNKNOWN:     return THREAD_STATE_UNKNOWN;
+        case BIRNET_THREAD_RUNNING:     return THREAD_STATE_RUNNING;
+        case BIRNET_THREAD_SLEEPING:    return THREAD_STATE_SLEEPING;
+        case BIRNET_THREAD_DISKWAIT:    return THREAD_STATE_DISKWAIT;
+        case BIRNET_THREAD_TRACED:      return THREAD_STATE_TRACED;
+        case BIRNET_THREAD_PAGING:      return THREAD_STATE_PAGING;
+        case BIRNET_THREAD_ZOMBIE:      return THREAD_STATE_ZOMBIE;
+        case BIRNET_THREAD_DEAD:        return THREAD_STATE_DEAD;
         }
     }
     static void assign (ThreadInfoHandle &th,
@@ -61,27 +61,27 @@
   };
   ThreadTotalsHandle tth (Sfi::INIT_DEFAULT);
   BirnetThreadInfo *ti;
-  ti = birnet_thread_info_collect (bse_main_thread);
+  ti = sfi_thread_info_collect (bse_main_thread);
   tth->main = ThreadInfoHandle (Sfi::INIT_DEFAULT);
   Sub::assign (tth->main, ti);
-  birnet_thread_info_free (ti);
+  sfi_thread_info_free (ti);
   if (bse_sequencer_thread)
     {
-      ti = birnet_thread_info_collect (bse_sequencer_thread);
+      ti = sfi_thread_info_collect (bse_sequencer_thread);
       tth->sequencer = ThreadInfoHandle (Sfi::INIT_DEFAULT);
       Sub::assign (tth->sequencer, ti);
-      birnet_thread_info_free (ti);
+      sfi_thread_info_free (ti);
     }
   guint n;
   BirnetThread **t;
   t = bse_engine_get_threads (&n);
   for (guint i = 0; i < n; i++)
     {
-      ti = birnet_thread_info_collect (t[i]);
+      ti = sfi_thread_info_collect (t[i]);
       tth->synthesis.resize (i + 1);
       tth->synthesis[i] = ThreadInfoHandle (Sfi::INIT_DEFAULT);
       Sub::assign (tth->synthesis[i], ti);
-      birnet_thread_info_free (ti);
+      sfi_thread_info_free (ti);
     }
   g_free (t);
   return tth;

Modified: trunk/bse/bseengine.c
===================================================================
--- trunk/bse/bseengine.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bseengine.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -82,7 +82,7 @@
   node->outputs = ENGINE_NODE_N_OSTREAMS (node) ? sfi_new_struct0 (EngineOutput, ENGINE_NODE_N_OSTREAMS (node)) : NULL;
   node->output_nodes = NULL;
   node->integrated = FALSE;
-  birnet_rec_mutex_init (&node->rec_mutex);
+  sfi_rec_mutex_init (&node->rec_mutex);
   for (i = 0; i < ENGINE_NODE_N_OSTREAMS (node); i++)
     node->outputs[i].buffer = node->module.ostreams[i].values;
   node->flow_jobs = NULL;
@@ -1039,10 +1039,10 @@
 	}
       else
 	bse_trans_commit (data->trans);
-      birnet_mutex_lock (&data->mutex);
+      sfi_mutex_lock (&data->mutex);
       data->trans = NULL;
-      birnet_mutex_unlock (&data->mutex);
-      birnet_cond_signal (&data->cond);
+      sfi_mutex_unlock (&data->mutex);
+      sfi_cond_signal (&data->cond);
       return FALSE;
     }
   return TRUE;
@@ -1073,16 +1073,16 @@
       DTrans data = { 0, };
       data.trans = trans;
       data.tick_stamp = tick_stamp;
-      birnet_cond_init (&data.cond);
-      birnet_mutex_init (&data.mutex);
+      sfi_cond_init (&data.cond);
+      sfi_mutex_init (&data.mutex);
       bse_trans_add (wtrans, bse_job_add_timer (dtrans_timer, &data, NULL));
-      birnet_mutex_lock (&data.mutex);
+      sfi_mutex_lock (&data.mutex);
       bse_trans_commit (wtrans);
       while (data.trans)
-	birnet_cond_wait (&data.cond, &data.mutex);
-      birnet_mutex_unlock (&data.mutex);
-      birnet_cond_destroy (&data.cond);
-      birnet_mutex_destroy (&data.mutex);
+	sfi_cond_wait (&data.cond, &data.mutex);
+      sfi_mutex_unlock (&data.mutex);
+      sfi_cond_destroy (&data.cond);
+      sfi_mutex_destroy (&data.mutex);
     }
 }
 
@@ -1378,7 +1378,7 @@
       sync_lock = TRUE;
     }
   while (!sync_lock)
-    birnet_cond_wait (&sync_cond, &sync_mutex);
+    sfi_cond_wait (&sync_cond, &sync_mutex);
   GSL_SPIN_UNLOCK (&sync_mutex);
   
   if (!_engine_mnl_head())
@@ -1399,7 +1399,7 @@
   /* unblock master */
   GSL_SPIN_LOCK (&sync_mutex);
   sync_lock = FALSE;
-  birnet_cond_signal (&sync_cond);
+  sfi_cond_signal (&sync_cond);
   GSL_SPIN_UNLOCK (&sync_mutex);
   /* ensure SYNC job got collected */
   bse_engine_wait_on_trans();
@@ -1444,7 +1444,7 @@
   if (bse_engine_threaded)
     {
       gint err = pipe (master_data.wakeup_pipe);
-      master_data.user_thread = birnet_thread_self ();
+      master_data.user_thread = sfi_thread_self ();
       if (!err)
 	{
 	  glong d_long = fcntl (master_data.wakeup_pipe[0], F_GETFL, 0);
@@ -1461,11 +1461,11 @@
 	}
       if (err)
 	g_error ("failed to create wakeup pipe: %s", g_strerror (errno));
-      master_thread = birnet_thread_run ("DSP #1", (BirnetThreadFunc) bse_engine_master_thread, &master_data);
+      master_thread = sfi_thread_run ("DSP #1", (BirnetThreadFunc) bse_engine_master_thread, &master_data);
       if (!master_thread)
 	g_error ("failed to create master thread");
       if (0)
-	birnet_thread_run ("DSP #2", slave, NULL);
+	sfi_thread_run ("DSP #2", slave, NULL);
     }
 }
 

Modified: trunk/bse/bseenginemaster.c
===================================================================
--- trunk/bse/bseenginemaster.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bseenginemaster.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -320,9 +320,9 @@
       master_schedule_discard();
       GSL_SPIN_LOCK (job->sync.lock_mutex);
       *job->sync.lock_p = TRUE;
-      birnet_cond_signal (job->sync.lock_cond);
+      sfi_cond_signal (job->sync.lock_cond);
       while (*job->sync.lock_p)
-        birnet_cond_wait (job->sync.lock_cond, job->sync.lock_mutex);
+        sfi_cond_wait (job->sync.lock_cond, job->sync.lock_mutex);
       GSL_SPIN_UNLOCK (job->sync.lock_mutex);
       break;
     case ENGINE_JOB_INTEGRATE:
@@ -1153,7 +1153,7 @@
   
   toyprof_stampinit ();
   
-  while (!birnet_thread_aborted ())        /* also updates accounting information */
+  while (!sfi_thread_aborted ())        /* also updates accounting information */
     {
       BseEngineLoop loop;
       gboolean need_dispatch;
@@ -1186,7 +1186,7 @@
       
       /* wakeup user thread if necessary */
       if (bse_engine_has_garbage ())
-	birnet_thread_wakeup (mdata->user_thread);
+	sfi_thread_wakeup (mdata->user_thread);
     }
 }
 

Modified: trunk/bse/bseenginenode.h
===================================================================
--- trunk/bse/bseenginenode.h	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bseenginenode.h	2006-10-07 18:50:38 UTC (rev 3941)
@@ -36,8 +36,8 @@
 #define	ENGINE_NODE_IS_SCHEDULED(node)	(ENGINE_NODE (node)->sched_tag)
 #define	ENGINE_NODE_IS_CHEAP(node)	(((node)->module.klass->mflags & BSE_COST_CHEAP) != 0)
 #define	ENGINE_NODE_IS_EXPENSIVE(node)	(((node)->module.klass->mflags & BSE_COST_EXPENSIVE) != 0)
-#define	ENGINE_NODE_LOCK(node)		birnet_rec_mutex_lock (&(node)->rec_mutex)
-#define	ENGINE_NODE_UNLOCK(node)	birnet_rec_mutex_unlock (&(node)->rec_mutex)
+#define	ENGINE_NODE_LOCK(node)		sfi_rec_mutex_lock (&(node)->rec_mutex)
+#define	ENGINE_NODE_UNLOCK(node)	sfi_rec_mutex_unlock (&(node)->rec_mutex)
 #define	ENGINE_MODULE_IS_VIRTUAL(mod)	(ENGINE_NODE_IS_VIRTUAL (ENGINE_NODE (mod)))
 
 

Modified: trunk/bse/bseengineutils.c
===================================================================
--- trunk/bse/bseengineutils.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bseengineutils.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -107,7 +107,7 @@
   g_return_if_fail (node->tjob_head == NULL);
   g_return_if_fail (node->probe_jobs == NULL);
 
-  birnet_rec_mutex_destroy (&node->rec_mutex);
+  sfi_rec_mutex_destroy (&node->rec_mutex);
   if (node->module.ostreams)
     {
       /* bse_engine_block_size() may have changed since allocation */
@@ -231,7 +231,7 @@
   cqueue_trans_pending_tail = trans;
   guint64 base_stamp = cqueue_commit_base_stamp;
   GSL_SPIN_UNLOCK (&cqueue_trans);
-  birnet_cond_broadcast (&cqueue_trans_cond);
+  sfi_cond_broadcast (&cqueue_trans_cond);
   return base_stamp + bse_engine_block_size();  /* returns tick_stamp of when this transaction takes effect */
 }
 
@@ -240,7 +240,7 @@
 {
   GSL_SPIN_LOCK (&cqueue_trans);
   while (cqueue_trans_pending_head || cqueue_trans_active_head)
-    birnet_cond_wait (&cqueue_trans_cond, &cqueue_trans);
+    sfi_cond_wait (&cqueue_trans_cond, &cqueue_trans);
   GSL_SPIN_UNLOCK (&cqueue_trans);
 }
 
@@ -323,7 +323,7 @@
           if (!cqueue_trans_job && update_commit_stamp)
             cqueue_commit_base_stamp = gsl_tick_stamp();        /* last job has been handed out */
 	  GSL_SPIN_UNLOCK (&cqueue_trans);
-	  birnet_cond_broadcast (&cqueue_trans_cond);
+	  sfi_cond_broadcast (&cqueue_trans_cond);
 	}
       else	/* not currently processing a transaction */
 	{
@@ -555,7 +555,7 @@
   pqueue_n_nodes -= 1;
   ENGINE_NODE_UNLOCK (node);
   if (!pqueue_n_nodes && !pqueue_n_cycles && BSE_ENGINE_SCHEDULE_NONPOPABLE (pqueue_schedule))
-    birnet_cond_signal (&pqueue_done_cond);
+    sfi_cond_signal (&pqueue_done_cond);
   GSL_SPIN_UNLOCK (&pqueue_mutex);
 }
 
@@ -578,7 +578,7 @@
 {
   GSL_SPIN_LOCK (&pqueue_mutex);
   while (pqueue_n_nodes || pqueue_n_cycles || !BSE_ENGINE_SCHEDULE_NONPOPABLE (pqueue_schedule))
-    birnet_cond_wait (&pqueue_done_cond, &pqueue_mutex);
+    sfi_cond_wait (&pqueue_done_cond, &pqueue_mutex);
   GSL_SPIN_UNLOCK (&pqueue_mutex);
 }
 
@@ -852,10 +852,10 @@
   if (!initialized)
     {
       initialized = TRUE;
-      birnet_mutex_init (&cqueue_trans);
-      birnet_cond_init (&cqueue_trans_cond);
-      birnet_mutex_init (&pqueue_mutex);
-      birnet_cond_init (&pqueue_done_cond);
+      sfi_mutex_init (&cqueue_trans);
+      sfi_cond_init (&cqueue_trans_cond);
+      sfi_mutex_init (&pqueue_mutex);
+      sfi_cond_init (&pqueue_done_cond);
     }
 }
 

Modified: trunk/bse/bsemain.c
===================================================================
--- trunk/bse/bsemain.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bsemain.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -108,7 +108,7 @@
   /* initialize submodules */
   sfi_init (argc, argv, app_name, values);
   bse_main_args = &default_main_args;
-  bse_main_args->birnet = *birnet_init_settings;
+  bse_main_args->birnet = sfi_init_settings();
 
   /* handle argument early*/
   if (argc && argv)
@@ -119,13 +119,13 @@
     }
   
   /* start main BSE thread */
-  thread = birnet_thread_run ("BSE Core", bse_main_loop, birnet_thread_self ());
+  thread = sfi_thread_run ("BSE Core", bse_main_loop, sfi_thread_self ());
   if (!thread)
     g_error ("failed to start seperate thread for BSE core");
 
   /* wait for initialization completion of the core thread */
   while (bse_initialization_stage < 2)
-    birnet_thread_sleep (-1);
+    sfi_thread_sleep (-1);
 }
 
 gchar*
@@ -161,12 +161,12 @@
   SfiComPort *port1, *port2;
 
   sfi_com_port_create_linked ("Client", adata->thread, &port1,
-			      "Server", birnet_thread_self (), &port2);
+			      "Server", sfi_thread_self (), &port2);
   adata->context = sfi_glue_encoder_context (port1);
   bse_janitor_new (port2);
 
   /* wakeup client */
-  birnet_thread_wakeup (adata->thread);
+  sfi_thread_wakeup (adata->thread);
 
   return FALSE; /* single-shot */
 }
@@ -190,7 +190,7 @@
   source = g_idle_source_new ();
   g_source_set_priority (source, G_PRIORITY_HIGH);
   adata.client = client;
-  adata.thread = birnet_thread_self ();
+  adata.thread = sfi_thread_self ();
   g_source_set_callback (source, async_create_context, &adata, NULL);
   g_source_attach (source, bse_main_context);
   g_source_unref (source);
@@ -199,7 +199,7 @@
 
   /* wait til context creation */
   do
-    birnet_thread_sleep (-1);
+    sfi_thread_sleep (-1);
   while (!adata.context);
 
   return adata.context;
@@ -209,9 +209,9 @@
 bse_init_core (void)
 {
   /* global threading things */
-  birnet_mutex_init (&bse_main_sequencer_mutex);
+  sfi_mutex_init (&bse_main_sequencer_mutex);
   bse_main_context = g_main_context_new ();
-  birnet_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup,
+  sfi_thread_set_wakeup ((BirnetThreadWakeup) g_main_context_wakeup,
 			 bse_main_context, NULL);
   sfi_msg_set_thread_handler (bse_msg_handler);
 
@@ -310,7 +310,7 @@
   else
     sfi_init (argc, argv, app_name, values);
   bse_main_args = &default_main_args;
-  bse_main_args->birnet = *birnet_init_settings;
+  bse_main_args->birnet = sfi_init_settings();
 
   /* early argument handling */
   if (argc && argv)
@@ -374,7 +374,7 @@
 {
   BirnetThread *client = data;
 
-  bse_main_thread = birnet_thread_self ();
+  bse_main_thread = sfi_thread_self ();
 
   bse_init_core ();
 
@@ -383,7 +383,7 @@
 
   /* notify client about completion */
   bse_initialization_stage++;   /* =2 */
-  birnet_thread_wakeup (client);
+  sfi_thread_wakeup (client);
 
   /* and away into the main loop */
   do
@@ -391,14 +391,14 @@
       g_main_context_pending (bse_main_context);
       g_main_context_iteration (bse_main_context, TRUE);
     }
-  while (!birnet_thread_aborted ());
+  while (!sfi_thread_aborted ());
 }
 
 guint
 bse_main_getpid (void)
 {
   if (bse_initialization_stage >= 2)
-    return birnet_thread_self_pid ();
+    return sfi_thread_self_pid ();
   else
     return 0;
 }
@@ -446,8 +446,8 @@
   umsg->details = g_strdup (lmsg->details);
   umsg->janitor = NULL;
   g_free (umsg->process);
-  umsg->process = g_strdup (birnet_thread_get_name (NULL));
-  umsg->pid = birnet_thread_get_pid (NULL);
+  umsg->process = g_strdup (sfi_thread_get_name (NULL));
+  umsg->pid = sfi_thread_get_pid (NULL);
   /* queue an idle handler in the BSE Core thread */
   bse_idle_next (core_thread_send_message_async, umsg);
 }

Modified: trunk/bse/bsemain.h
===================================================================
--- trunk/bse/bsemain.h	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bsemain.h	2006-10-07 18:50:38 UTC (rev 3941)
@@ -53,8 +53,8 @@
 /* --- global macros --- */
 #define	BSE_THREADS_ENTER()			// bse_main_global_lock ()
 #define	BSE_THREADS_LEAVE()			// bse_main_global_unlock ()
-#define	BSE_SEQUENCER_LOCK()			birnet_mutex_lock (&bse_main_sequencer_mutex)
-#define	BSE_SEQUENCER_UNLOCK()			birnet_mutex_unlock (&bse_main_sequencer_mutex)
+#define	BSE_SEQUENCER_LOCK()			sfi_mutex_lock (&bse_main_sequencer_mutex)
+#define	BSE_SEQUENCER_UNLOCK()			sfi_mutex_unlock (&bse_main_sequencer_mutex)
 #define	BSE_DBG_EXT     			(bse_main_args->debug_extensions != FALSE)
 #define	BSE_CONFIG(field)			(bse_main_args->field)
 

Modified: trunk/bse/bsemidireceiver.cc
===================================================================
--- trunk/bse/bsemidireceiver.cc	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bsemidireceiver.cc	2006-10-07 18:50:38 UTC (rev 3941)
@@ -1208,7 +1208,7 @@
   
   g_assert (initialized++ == FALSE);
   
-  birnet_mutex_init (&global_midi_mutex);
+  sfi_mutex_init (&global_midi_mutex);
 }
 
 static gint

Modified: trunk/bse/bsepcmdevice-null.c
===================================================================
--- trunk/bse/bsepcmdevice-null.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bsepcmdevice-null.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -92,7 +92,7 @@
                       glong        *timeoutp)
 {
   /* keep the sequencer busy or we will constantly timeout */
-  birnet_thread_wakeup (bse_sequencer_thread);
+  sfi_thread_wakeup (bse_sequencer_thread);
   *timeoutp = 1;
   /* ensure sequencer fairness */
   return !bse_sequencer_thread_lagging (2);

Modified: trunk/bse/bsepcmdevice.c
===================================================================
--- trunk/bse/bsepcmdevice.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bsepcmdevice.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -77,14 +77,14 @@
   BsePcmDevice *self = BSE_PCM_DEVICE (device);
   g_return_if_fail (BSE_DEVICE_OPEN (self) && self->handle);
   g_return_if_fail (BSE_DEVICE_OPEN (self) && self->handle->block_length == 0);
-  birnet_mutex_init (&self->handle->mutex);
+  sfi_mutex_init (&self->handle->mutex);
 }
 
 static void
 pcm_device_pre_close (BseDevice *device)
 {
   BsePcmDevice *self = BSE_PCM_DEVICE (device);
-  birnet_mutex_destroy (&self->handle->mutex);
+  sfi_mutex_destroy (&self->handle->mutex);
 }
 
 guint

Modified: trunk/bse/bsepcmwriter.c
===================================================================
--- trunk/bse/bsepcmwriter.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bsepcmwriter.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -72,7 +72,7 @@
 static void
 bse_pcm_writer_init (BsePcmWriter *self)
 {
-  birnet_mutex_init (&self->mutex);
+  sfi_mutex_init (&self->mutex);
 }
 
 static void
@@ -88,7 +88,7 @@
 
   /* chain parent class' handler */
   G_OBJECT_CLASS (parent_class)->finalize (object);
-  birnet_mutex_destroy (&self->mutex);
+  sfi_mutex_destroy (&self->mutex);
 }
 
 BseErrorType
@@ -106,7 +106,7 @@
   g_return_val_if_fail (n_channels > 0, BSE_ERROR_INTERNAL);
   g_return_val_if_fail (sample_freq >= 1000, BSE_ERROR_INTERNAL);
 
-  birnet_mutex_lock (&self->mutex);
+  sfi_mutex_lock (&self->mutex);
 
   error = 0;
 
@@ -114,7 +114,7 @@
   fd = open (file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
   if (fd < 0)
     {
-      birnet_mutex_unlock (&self->mutex);
+      sfi_mutex_unlock (&self->mutex);
       return bse_error_from_errno (errno, BSE_ERROR_FILE_OPEN_FAILED);
     }
 
@@ -122,14 +122,14 @@
   if (errno)
     {
       close (fd);
-      birnet_mutex_unlock (&self->mutex);
+      sfi_mutex_unlock (&self->mutex);
       return bse_error_from_errno (errno, BSE_ERROR_FILE_OPEN_FAILED);
     }
   self->fd = fd;
   self->open = TRUE;
   self->broken = FALSE;
 
-  birnet_mutex_unlock (&self->mutex);
+  sfi_mutex_unlock (&self->mutex);
   return BSE_ERROR_NONE;
 }
 
@@ -139,12 +139,12 @@
   g_return_if_fail (BSE_IS_PCM_WRITER (self));
   g_return_if_fail (self->open);
 
-  birnet_mutex_lock (&self->mutex);
+  sfi_mutex_lock (&self->mutex);
   bse_wave_file_patch_length (self->fd, self->n_bytes);
   close (self->fd);
   self->fd = -1;
   self->open = FALSE;
-  birnet_mutex_unlock (&self->mutex);
+  sfi_mutex_unlock (&self->mutex);
   errno = 0;
 }
 
@@ -160,7 +160,7 @@
   else
     return;
 
-  birnet_mutex_lock (&self->mutex);
+  sfi_mutex_lock (&self->mutex);
   if (!self->broken)
     {
       guint j;
@@ -182,5 +182,5 @@
 	  self->broken = TRUE;
 	}
     }
-  birnet_mutex_unlock (&self->mutex);
+  sfi_mutex_unlock (&self->mutex);
 }

Modified: trunk/bse/bseplugin.c
===================================================================
--- trunk/bse/bseplugin.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bseplugin.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -22,7 +22,6 @@
 #include "bseobject.h"
 #include "bseenums.h"
 #include "bsemain.h"
-#include <birnet/birnetcpu.h>
 #include <gmodule.h>
 #include <string.h>
 #include <fcntl.h>
@@ -698,10 +697,10 @@
     }
   if (true)
     {
-      const BirnetCPUInfo *cpu_info = birnet_cpu_info();
+      const SfiCPUInfo cpu_info = sfi_cpu_info();
       const char *exts[] = { ".FPU.so", ".FPU.la", ".so", ".la", };
       if (BSE_WITH_SSE_FLAGS && !bse_main_args->force_fpu &&
-          cpu_info->x86_mmx && cpu_info->x86_sse && cpu_info->x86_ssesys)
+          cpu_info.x86_mmx && cpu_info.x86_sse && cpu_info.x86_ssesys)
         {
           exts[0] = ".SSE.so";  /* !".FPU.so" */
           exts[1] = ".SSE.la";  /* !".FPU.la" */

Modified: trunk/bse/bsesequencer.cc
===================================================================
--- trunk/bse/bsesequencer.cc	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/bsesequencer.cc	2006-10-07 18:50:38 UTC (rev 3941)
@@ -61,7 +61,7 @@
 {
   g_assert (bse_sequencer_thread == NULL);
 
-  birnet_cond_init (&current_watch_cond);
+  sfi_cond_init (&current_watch_cond);
 
   if (pipe (sequencer_wake_up_pipe) < 0)
     g_error ("failed to create sequencer wake-up pipe: %s", strerror (errno));
@@ -76,7 +76,7 @@
   g_assert (sseq.stamp > 0);
   global_sequencer = &sseq;
 
-  bse_sequencer_thread = birnet_thread_run ("Sequencer", bse_sequencer_thread_main, NULL);
+  bse_sequencer_thread = sfi_thread_run ("Sequencer", bse_sequencer_thread_main, NULL);
   if (!bse_sequencer_thread)
     g_error ("failed to create sequencer thread");
 }
@@ -235,7 +235,7 @@
   BSE_SEQUENCER_LOCK ();
   if (current_watch_func == watch_func && current_watch_data == watch_data)
     {  /* watch_func() to be removed is currently in call */
-      if (bse_sequencer_thread == birnet_thread_self())
+      if (bse_sequencer_thread == sfi_thread_self())
         {
           /* allow removal calls from within a watch_func() */
           removal_success = !current_watch_needs_remove1;       /* catch multiple calls */
@@ -248,14 +248,14 @@
           current_watch_needs_remove2 = true;
           /* wait until watch_func() call has finished */
           while (current_watch_func == watch_func && current_watch_data == watch_data)
-            birnet_cond_wait (&current_watch_cond, &bse_main_sequencer_mutex);
+            sfi_cond_wait (&current_watch_cond, &bse_main_sequencer_mutex);
         }
     }
   else /* can remove (watch_func(watch_data) not in call) */
     {
       removal_success = sequencer_poll_pool.remove_watch (watch_func, watch_data);
       /* wake up sequencer thread, so it stops polling on fds it doesn't own anymore */
-      birnet_thread_wakeup (bse_sequencer_thread);
+      sfi_thread_wakeup (bse_sequencer_thread);
     }
   BSE_SEQUENCER_UNLOCK ();
   if (!removal_success)
@@ -301,10 +301,10 @@
           current_watch_needs_remove2 = false;
           current_watch_func = NULL;
           current_watch_data = NULL;
-          birnet_cond_broadcast (&current_watch_cond);     /* wake up threads in bse_sequencer_remove_io_watch() */
+          sfi_cond_broadcast (&current_watch_cond);     /* wake up threads in bse_sequencer_remove_io_watch() */
         }
     }
-  return !birnet_thread_aborted();
+  return !sfi_thread_aborted();
 }
 
 extern "C" void
@@ -334,7 +334,7 @@
     }
   global_sequencer->songs = sfi_ring_append (global_sequencer->songs, song);
   BSE_SEQUENCER_UNLOCK ();
-  birnet_thread_wakeup (bse_sequencer_thread);
+  sfi_thread_wakeup (bse_sequencer_thread);
 }
 
 extern "C" void
@@ -405,7 +405,7 @@
 bse_sequencer_thread_main (gpointer data)
 {
   DEBUG ("SST: start\n");
-  birnet_thread_set_wakeup (sequencer_wake_up, NULL, NULL);
+  sfi_thread_set_wakeup (sequencer_wake_up, NULL, NULL);
   sfi_msg_set_thread_handler (bse_msg_handler);
   BSE_SEQUENCER_LOCK ();
   do
@@ -444,7 +444,7 @@
 	}
       global_sequencer->stamp = next_stamp;
       
-      birnet_thread_awake_after (cur_stamp + bse_engine_block_size ());
+      sfi_thread_awake_after (cur_stamp + bse_engine_block_size ());
     }
   while (bse_sequencer_poll_Lm (-1));
   BSE_SEQUENCER_UNLOCK ();

Modified: trunk/bse/gslcommon.c
===================================================================
--- trunk/bse/gslcommon.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/gslcommon.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -48,8 +48,8 @@
  * by specific amounts (refer to bse_engine_init() for further
  * details). The tick stamp is a non-wrapping, unsigned 64bit
  * integer greater than 0. Threads can schedule sleep interruptions
- * at certain tick stamps with birnet_thread_awake_after() and
- * birnet_thread_awake_before(). Tick stamp updating occours at
+ * at certain tick stamps with sfi_thread_awake_after() and
+ * sfi_thread_awake_before(). Tick stamp updating occours at
  * GSL engine block processing boundaries, so code that can
  * guarantee to not run across those boundaries (for instance
  * BseProcessFunc() functions) may use the macro %GSL_TICK_STAMP
@@ -113,7 +113,7 @@
   tick_stamp_system_time = systime;
   GSL_SPIN_UNLOCK (&global_tick_stamp_mutex);
 
-  birnet_thread_emit_wakeups (newstamp);
+  sfi_thread_emit_wakeups (newstamp);
 }
 
 /**
@@ -131,9 +131,9 @@
   g_return_if_fail (tick_stamp > 0);
 
   if (tick_stamp > global_tick_stamp_leaps)
-    birnet_thread_awake_after (tick_stamp - global_tick_stamp_leaps);
+    sfi_thread_awake_after (tick_stamp - global_tick_stamp_leaps);
   else
-    birnet_thread_awake_after (tick_stamp);
+    sfi_thread_awake_after (tick_stamp);
 }
 
 
@@ -369,7 +369,7 @@
   bse_engine_exvar_tick_stamp = 1;
 
   /* initialize subsystems */
-  birnet_mutex_init (&global_tick_stamp_mutex);
+  sfi_mutex_init (&global_tick_stamp_mutex);
   _gsl_init_fd_pool ();
   _gsl_init_data_caches ();
   _gsl_init_loader_gslwave ();

Modified: trunk/bse/gslcommon.h
===================================================================
--- trunk/bse/gslcommon.h	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/gslcommon.h	2006-10-07 18:50:38 UTC (rev 3941)
@@ -39,10 +39,10 @@
 #define		   GSL_TICK_STAMP	(_GSL_TICK_STAMP_VAL ())
 #define		   GSL_MAX_TICK_STAMP	(18446744073709551615LLU /* 2^64-1*/)
 void		gsl_thread_awake_before	(guint64	 tick_stamp);
-#define	GSL_SPIN_LOCK	birnet_mutex_lock
-#define	GSL_SPIN_UNLOCK	birnet_mutex_unlock
-#define	GSL_SYNC_LOCK	birnet_mutex_lock
-#define	GSL_SYNC_UNLOCK	birnet_mutex_unlock
+#define	GSL_SPIN_LOCK	sfi_mutex_lock
+#define	GSL_SPIN_UNLOCK	sfi_mutex_unlock
+#define	GSL_SYNC_LOCK	sfi_mutex_lock
+#define	GSL_SYNC_UNLOCK	sfi_mutex_unlock
 
 
 /* --- misc --- */

Modified: trunk/bse/gsldatacache.c
===================================================================
--- trunk/bse/gsldatacache.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/gsldatacache.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -81,8 +81,8 @@
   initialized++;
 
   g_static_assert (AGE_EPSILON < LOW_PERSISTENCY_RESIDENT_SET);
-  birnet_cond_init (&global_dcache_cond_node_filled);
-  birnet_mutex_init (&global_dcache_mutex);
+  sfi_cond_init (&global_dcache_cond_node_filled);
+  sfi_mutex_init (&global_dcache_mutex);
 }
 
 GslDataCache*
@@ -102,7 +102,7 @@
   dcache = sfi_new_struct (GslDataCache, 1);
   dcache->dhandle = gsl_data_handle_ref (dhandle);
   dcache->open_count = 0;
-  birnet_mutex_init (&dcache->mutex);
+  sfi_mutex_init (&dcache->mutex);
   dcache->ref_count = 1;
   dcache->node_size = node_size;
   dcache->padding = padding;
@@ -193,7 +193,7 @@
   g_return_if_fail (dcache->open_count == 0);
 
   gsl_data_handle_unref (dcache->dhandle);
-  birnet_mutex_destroy (&dcache->mutex);
+  sfi_mutex_destroy (&dcache->mutex);
   for (i = 0; i < dcache->n_nodes; i++)
     {
       GslDataCacheNode *node = dcache->nodes[i];
@@ -379,7 +379,7 @@
 
   GSL_SPIN_LOCK (&dcache->mutex);
   dnode->data = node_data;
-  birnet_cond_broadcast (&global_dcache_cond_node_filled);
+  sfi_cond_broadcast (&global_dcache_cond_node_filled);
   
   return dnode;
 }
@@ -425,7 +425,7 @@
 	  node->ref_count++;
 	  if (load_request == GSL_DATA_CACHE_DEMAND_LOAD)
 	    while (!node->data)
-	      birnet_cond_wait (&global_dcache_cond_node_filled, &dcache->mutex);
+	      sfi_cond_wait (&global_dcache_cond_node_filled, &dcache->mutex);
 	  GSL_SPIN_UNLOCK (&dcache->mutex);
 	  /* g_printerr ("hit: %d :%d: %d\n", node->offset, offset, node->offset + dcache->node_size); */
 

Modified: trunk/bse/gsldatahandle.c
===================================================================
--- trunk/bse/gsldatahandle.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/gsldatahandle.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -46,7 +46,7 @@
   g_return_val_if_fail (dhandle->ref_count == 0, FALSE);
   
   dhandle->name = g_strdup (file_name);
-  birnet_mutex_init (&dhandle->mutex);
+  sfi_mutex_init (&dhandle->mutex);
   dhandle->ref_count = 1;
   dhandle->open_count = 0;
   memset (&dhandle->setup, 0, sizeof (dhandle->setup));
@@ -76,7 +76,7 @@
   
   g_free (dhandle->name);
   dhandle->name = NULL;
-  birnet_mutex_destroy (&dhandle->mutex);
+  sfi_mutex_destroy (&dhandle->mutex);
 }
 
 void

Modified: trunk/bse/gslfilehash.c
===================================================================
--- trunk/bse/gslfilehash.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/gslfilehash.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -69,7 +69,7 @@
 {
   g_assert (hfile_ht == NULL);
   
-  birnet_mutex_init (&fdpool_mutex);
+  sfi_mutex_init (&fdpool_mutex);
   hfile_ht = g_hash_table_new (hfile_hash, hfile_equals);
 }
 
@@ -115,13 +115,13 @@
   if (!stat_file (file_name, &key.mtime, &key.n_bytes))
     return NULL;	/* errno from stat() */
   
-  birnet_mutex_lock (&fdpool_mutex);
+  sfi_mutex_lock (&fdpool_mutex);
   hfile = g_hash_table_lookup (hfile_ht, &key);
   if (hfile)
     {
-      birnet_mutex_lock (&hfile->mutex);
+      sfi_mutex_lock (&hfile->mutex);
       hfile->ocount++;
-      birnet_mutex_unlock (&hfile->mutex);
+      sfi_mutex_unlock (&hfile->mutex);
       ret_errno = 0;
     }
   else
@@ -139,14 +139,14 @@
 	  hfile->fd = fd;
 	  hfile->ocount = 1;
 	  hfile->zoffset = -2;
-	  birnet_mutex_init (&hfile->mutex);
+	  sfi_mutex_init (&hfile->mutex);
 	  g_hash_table_insert (hfile_ht, hfile, hfile);
 	  ret_errno = 0;
 	}
       else
 	ret_errno = errno;
     }
-  birnet_mutex_unlock (&fdpool_mutex);
+  sfi_mutex_unlock (&fdpool_mutex);
   
   errno = ret_errno;
   return hfile;
@@ -167,8 +167,8 @@
   g_return_if_fail (hfile != NULL);
   g_return_if_fail (hfile->ocount > 0);
   
-  birnet_mutex_lock (&fdpool_mutex);
-  birnet_mutex_lock (&hfile->mutex);
+  sfi_mutex_lock (&fdpool_mutex);
+  sfi_mutex_lock (&hfile->mutex);
   if (hfile->ocount > 1)
     hfile->ocount--;
   else
@@ -182,12 +182,12 @@
 	  destroy = TRUE;
 	}
     }
-  birnet_mutex_unlock (&hfile->mutex);
-  birnet_mutex_unlock (&fdpool_mutex);
+  sfi_mutex_unlock (&hfile->mutex);
+  sfi_mutex_unlock (&fdpool_mutex);
   
   if (destroy)
     {
-      birnet_mutex_destroy (&hfile->mutex);
+      sfi_mutex_destroy (&hfile->mutex);
       close (hfile->fd);
       g_free (hfile->file_name);
       sfi_delete_struct (GslHFile, hfile);
@@ -226,7 +226,7 @@
     }
   g_return_val_if_fail (bytes != NULL, -1);
   
-  birnet_mutex_lock (&hfile->mutex);
+  sfi_mutex_lock (&hfile->mutex);
   if (hfile->ocount)
     {
       if (hfile->cpos != offset)
@@ -235,7 +235,7 @@
 	  if (hfile->cpos < 0 && errno != EINVAL)
 	    {
 	      ret_errno = errno;
-	      birnet_mutex_unlock (&hfile->mutex);
+	      sfi_mutex_unlock (&hfile->mutex);
 	      errno = ret_errno;
 	      return -1;
 	    }
@@ -268,7 +268,7 @@
     }
   else
     ret_errno = EFAULT;
-  birnet_mutex_unlock (&hfile->mutex);
+  sfi_mutex_unlock (&hfile->mutex);
   
   errno = ret_errno;
   return ret_bytes;
@@ -293,20 +293,20 @@
   g_return_val_if_fail (hfile != NULL, -1);
   g_return_val_if_fail (hfile->ocount > 0, -1);
 
-  birnet_mutex_lock (&hfile->mutex);
+  sfi_mutex_lock (&hfile->mutex);
   if (hfile->zoffset > -2) /* got valid offset already */
     {
       zoffset = hfile->zoffset;
-      birnet_mutex_unlock (&hfile->mutex);
+      sfi_mutex_unlock (&hfile->mutex);
       return zoffset;
     }
   if (!hfile->ocount) /* bad */
     {
-      birnet_mutex_unlock (&hfile->mutex);
+      sfi_mutex_unlock (&hfile->mutex);
       return -1;
     }
   hfile->ocount += 1; /* keep open for a while */
-  birnet_mutex_unlock (&hfile->mutex);
+  sfi_mutex_unlock (&hfile->mutex);
 
   /* seek to literal '\0' */
   zoffset = 0;
@@ -329,10 +329,10 @@
   if (!seen_zero)
     zoffset = -1;
 
-  birnet_mutex_lock (&hfile->mutex);
+  sfi_mutex_lock (&hfile->mutex);
   if (hfile->zoffset < -1)
     hfile->zoffset = zoffset;
-  birnet_mutex_unlock (&hfile->mutex);
+  sfi_mutex_unlock (&hfile->mutex);
 
   gsl_hfile_close (hfile);
 

Modified: trunk/bse/tests/blocktests.cc
===================================================================
--- trunk/bse/tests/blocktests.cc	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/tests/blocktests.cc	2006-10-07 18:50:38 UTC (rev 3941)
@@ -19,7 +19,7 @@
  */
 #include <bse/bseblockutils.hh>
 // #define TEST_VERBOSE
-#include <birnet/birnettests.h>
+#include <sfi/sfitests.h>
 #include <bse/bsemain.h>
 #include "topconfig.h"
 
@@ -575,7 +575,7 @@
       char *argv[])
 {
   /* usually we'd call bse_init_test() here, but we have tests to rnu before plugins are loaded */
-  birnet_init_test (&argc, &argv);
+  sfi_init_test (&argc, &argv, NULL);
 
   TSTART ("Running Default Block Ops");
   TASSERT (Bse::Block::default_singleton() == Bse::Block::current_singleton());

Modified: trunk/bse/tests/resamplehandle.cc
===================================================================
--- trunk/bse/tests/resamplehandle.cc	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/bse/tests/resamplehandle.cc	2006-10-07 18:50:38 UTC (rev 3941)
@@ -20,7 +20,7 @@
 #include <bse/bsemathsignal.h>
 #include <bse/bsemain.h>
 // #define TEST_VERBOSE
-#include <birnet/birnettests.h>
+#include <sfi/sfitests.h>
 #include <bse/gsldatautils.h>
 #include <bse/bseblockutils.hh>
 #include <vector>
@@ -275,7 +275,7 @@
 main (int   argc,
       char *argv[])
 {
-  birnet_init_test (&argc, &argv);
+  sfi_init_test (&argc, &argv, NULL);
   
   test_c_api ("FPU");
   run_tests ("FPU");

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/configure.in	2006-10-07 18:50:38 UTC (rev 3941)
@@ -72,6 +72,7 @@
 
 # architecture information
 AC_CANONICAL_TARGET
+dnl # AC_CANONICAL_HOST is provided by AC_CANONICAL_TARGET
 AC_DEFINE_UNQUOTED(BST_ARCH_NAME, "$target", [Architecture Description])
 
 # initialize automake, don't define PACKAGE and VERSION

Modified: trunk/po/POTFILES.in
===================================================================
--- trunk/po/POTFILES.in	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/po/POTFILES.in	2006-10-07 18:50:38 UTC (rev 3941)
@@ -60,7 +60,7 @@
 beast-gtk/gxk/gxkparam-spinner.c
 beast-gtk/gxk/gxkparam-toggle.c
 beast-gtk/gxk/gxksimplelabel.c
-birnet/birnetmsg.c
+birnet/birnetutils.cc
 bse/bseautodoc.c
 bse/bsebiquadfilter.c
 bse/bsebus.c
@@ -128,4 +128,5 @@
 plugins/davsyndrum.c
 plugins/davxtalstrings.c
 plugins/freeverb/bsefreeverb.c
+sfi/sfimsg.c
 tools/bsewavetool.cc

Modified: trunk/po/POTFILES.skip
===================================================================
--- trunk/po/POTFILES.skip	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/po/POTFILES.skip	2006-10-07 18:50:38 UTC (rev 3941)
@@ -4,3 +4,4 @@
 plugins/bsefirfilter.c
 plugins/davguitar.c
 plugins/evaluator/bseevaluator.idl
+sfi/tests/testidl.c

Modified: trunk/sfi/ChangeLog
===================================================================
--- trunk/sfi/ChangeLog	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/ChangeLog	2006-10-07 18:50:38 UTC (rev 3941)
@@ -1,3 +1,14 @@
+Sat Oct  7 20:33:04 2006  Tim Janik  <timj gtk org>
+
+	* sfiwrapper.cc, sfiwrapper.h: provide integer types.
+	wrap cpu info and threading APIs. changed callers to use
+	the wrapped SFI variants.
+
+	* sfitypes.h: removed obsoleted cruft.
+
+	* tests/misctests.c: added compilation test for all threading
+	macros.
+
 Fri Oct  6 23:13:05 2006  Tim Janik  <timj gtk org>
 
 	* sfiwrapper.h, sfiwrapper.cc: C API wrapper around useful

Modified: trunk/sfi/sficomport.c
===================================================================
--- trunk/sfi/sficomport.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/sficomport.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -143,7 +143,7 @@
   g_return_if_fail (port1 && port2);
 
   link = g_new0 (SfiComPortLink, 1);
-  birnet_mutex_init (&link->mutex);
+  sfi_mutex_init (&link->mutex);
   link->port1 = sfi_com_port_from_child (ident1, -1, -1, -1);
   link->thread1 = thread1;
   link->port2 = sfi_com_port_from_child (ident2, -1, -1, -1);
@@ -155,7 +155,7 @@
   link->port2->connected = TRUE;
   *port1 = link->port1;
   *port2 = link->port2;
-  birnet_cond_init (&link->wcond);
+  sfi_cond_init (&link->wcond);
 }
 
 static void
@@ -168,8 +168,8 @@
     sfi_value_free (sfi_ring_pop_head (&link->p1queue));
   while (link->p2queue)
     sfi_value_free (sfi_ring_pop_head (&link->p2queue));
-  birnet_mutex_destroy (&link->mutex);
-  birnet_cond_destroy (&link->wcond);
+  sfi_mutex_destroy (&link->mutex);
+  sfi_cond_destroy (&link->wcond);
   g_free (link);
 }
 
@@ -254,7 +254,7 @@
     {
       SfiComPortLink *link = port->link;
       gboolean need_destroy;
-      birnet_mutex_lock (&link->mutex);
+      sfi_mutex_lock (&link->mutex);
       if (port == link->port1)
 	{
 	  link->port1 = NULL;
@@ -267,7 +267,7 @@
 	}
       link->ref_count--;
       need_destroy = link->ref_count == 0;
-      birnet_mutex_unlock (&link->mutex);
+      sfi_mutex_unlock (&link->mutex);
       port->link = NULL;
       if (need_destroy)
 	sfi_com_port_link_destroy (port->link);
@@ -392,19 +392,19 @@
       for (ring = value_ring; ring; ring = sfi_ring_next (ring, value_ring))
         target = sfi_ring_append (target, sfi_value_clone_deep (ring->data));
 
-      birnet_mutex_lock (&link->mutex);
+      sfi_mutex_lock (&link->mutex);
       if (first)
 	link->p1queue = sfi_ring_concat (link->p1queue, target);
       else
 	link->p2queue = sfi_ring_concat (link->p2queue, target);
       if (link->waiting)
-	birnet_cond_signal (&link->wcond);
+	sfi_cond_signal (&link->wcond);
       else
 	thread = first ? link->thread2 : link->thread1;
-      birnet_mutex_unlock (&link->mutex);
+      sfi_mutex_unlock (&link->mutex);
       MASS_DEBUG ("[%s: sent values]", port->ident);
       if (thread)
-	birnet_thread_wakeup (thread);
+	sfi_thread_wakeup (thread);
     }
   else
     for (ring = value_ring; ring; ring = sfi_ring_next (ring, value_ring))
@@ -575,7 +575,7 @@
     {
       SfiComPortLink *link = port->link;
       
-      birnet_mutex_lock (&link->mutex);
+      sfi_mutex_lock (&link->mutex);
     refetch:
       if (port == link->port1)
 	port->rvalues = link->p2queue, link->p2queue = NULL;
@@ -584,11 +584,11 @@
       if (!port->rvalues && blocking)
 	{
 	  link->waiting = TRUE;
-	  birnet_cond_wait (&link->wcond, &link->mutex);
+	  sfi_cond_wait (&link->wcond, &link->mutex);
 	  link->waiting = FALSE;
 	  goto refetch;
 	}
-      birnet_mutex_unlock (&link->mutex);
+      sfi_mutex_unlock (&link->mutex);
     }
   else if (!port->rvalues)
     {

Modified: trunk/sfi/sficxx.cc
===================================================================
--- trunk/sfi/sficxx.cc	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/sficxx.cc	2006-10-07 18:50:38 UTC (rev 3941)
@@ -26,6 +26,7 @@
 {
   g_type_init ();       /* just in case this hasn't been called already */
 
+  _sfi_init_logging ();
   _sfi_init_values ();
   _sfi_init_params ();
   _sfi_init_time ();

Modified: trunk/sfi/sfiglue.c
===================================================================
--- trunk/sfi/sfiglue.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/sfiglue.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -61,8 +61,8 @@
   g_return_if_fail (context != NULL);
   g_return_if_fail (context->table.destroy != NULL);
   
-  birnet_thread_set_qdata_full (quark_context_stack,
-			     sfi_ring_prepend (birnet_thread_steal_qdata (quark_context_stack),
+  sfi_thread_set_qdata_full (quark_context_stack,
+			     sfi_ring_prepend (sfi_thread_steal_qdata (quark_context_stack),
 					       context),
 			     (GDestroyNotify) sfi_ring_free);
 }
@@ -70,18 +70,18 @@
 SfiGlueContext*
 sfi_glue_context_current (void)
 {
-  SfiRing *context_stack = birnet_thread_get_qdata (quark_context_stack);
+  SfiRing *context_stack = sfi_thread_get_qdata (quark_context_stack);
   return context_stack ? context_stack->data : NULL;
 }
 
 void
 sfi_glue_context_pop (void)
 {
-  SfiRing *context_stack = birnet_thread_steal_qdata (quark_context_stack);
+  SfiRing *context_stack = sfi_thread_steal_qdata (quark_context_stack);
   
   g_return_if_fail (context_stack != NULL);
   
-  birnet_thread_set_qdata_full (quark_context_stack,
+  sfi_thread_set_qdata_full (quark_context_stack,
 			     sfi_ring_remove_node (context_stack, context_stack),
 			     (GDestroyNotify) sfi_ring_free);
 }

Modified: trunk/sfi/sfimemory.c
===================================================================
--- trunk/sfi/sfimemory.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/sfimemory.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -51,31 +51,31 @@
       
       mem_size = (mem_size + 7) & ~0x7;
       cell = (mem_size >> 3) - 1;
-      birnet_mutex_lock (&global_memory_mutex);
+      sfi_mutex_lock (&global_memory_mutex);
       mem = g_trash_stack_pop (simple_cache + cell);
-      birnet_mutex_unlock (&global_memory_mutex);
+      sfi_mutex_unlock (&global_memory_mutex);
       if (!mem)
 	{
 	  guint8 *cache_mem = g_malloc (mem_size * PREALLOC);
 	  guint i;
 	  
-	  birnet_mutex_lock (&global_memory_mutex);
+	  sfi_mutex_lock (&global_memory_mutex);
 	  memory_allocated += mem_size * PREALLOC;
 	  for (i = 0; i < PREALLOC - 1; i++)
 	    {
 	      g_trash_stack_push (simple_cache + cell, cache_mem);
 	      cache_mem += mem_size;
 	    }
-	  birnet_mutex_unlock (&global_memory_mutex);
+	  sfi_mutex_unlock (&global_memory_mutex);
 	  mem = cache_mem;
 	}
     }
   else
     {
       mem = g_malloc (mem_size);
-      birnet_mutex_lock (&global_memory_mutex);
+      sfi_mutex_lock (&global_memory_mutex);
       memory_allocated += mem_size;
-      birnet_mutex_unlock (&global_memory_mutex);
+      sfi_mutex_unlock (&global_memory_mutex);
     }
   return mem;
 }
@@ -90,16 +90,16 @@
       
       mem_size = (mem_size + 7) & ~0x7;
       cell = (mem_size >> 3) - 1;
-      birnet_mutex_lock (&global_memory_mutex);
+      sfi_mutex_lock (&global_memory_mutex);
       g_trash_stack_push (simple_cache + cell, mem);
-      birnet_mutex_unlock (&global_memory_mutex);
+      sfi_mutex_unlock (&global_memory_mutex);
     }
   else
     {
       g_free (mem);
-      birnet_mutex_lock (&global_memory_mutex);
+      sfi_mutex_lock (&global_memory_mutex);
       memory_allocated -= mem_size;
-      birnet_mutex_unlock (&global_memory_mutex);
+      sfi_mutex_unlock (&global_memory_mutex);
     }
 }
 #else
@@ -155,7 +155,7 @@
 {
   guint cell, cached = 0;
   
-  birnet_mutex_lock (&global_memory_mutex);
+  sfi_mutex_lock (&global_memory_mutex);
   for (cell = 0; cell < SIMPLE_CACHE_SIZE; cell++)
     {
       GTrashStack *trash = simple_cache[cell];
@@ -175,7 +175,7 @@
 	}
     }
   g_message ("%lu bytes allocated from system, %u bytes unused in cache", memory_allocated, cached);
-  birnet_mutex_unlock (&global_memory_mutex);
+  sfi_mutex_unlock (&global_memory_mutex);
 }
 
 gpointer
@@ -213,5 +213,5 @@
   gboolean initialized = FALSE;
   g_assert (initialized == FALSE);
   initialized = TRUE;
-  birnet_mutex_init (&global_memory_mutex);
+  sfi_mutex_init (&global_memory_mutex);
 }

Modified: trunk/sfi/sfimsg.c
===================================================================
--- trunk/sfi/sfimsg.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/sfimsg.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 #include "sfimsg.h"
+#include "sfiwrapper.h"
 #include <unistd.h>
 #include <stdio.h>
 #include <string.h>
@@ -59,7 +60,7 @@
 sfi_msg_type_init_internals (void)
 {
   static volatile guint initialized = FALSE;
-  if (initialized || !birnet_atomic_uint_compare_and_swap (&initialized, FALSE, TRUE))
+  if (initialized || !sfi_atomic_uint_cas (&initialized, FALSE, TRUE))
     return;
   guint mtype;
   /* SFI_MSG_NONE (always disabled) */
@@ -102,7 +103,7 @@
   g_assert (quark_log_handler == 0);
   quark_log_handler = g_quark_from_static_string ("SfiMsgHandler");
   quark_msg_bits = g_quark_from_static_string ("SfiMsgBit-threadlist");
-  birnet_mutex_init (&logging_mutex);
+  sfi_mutex_init (&logging_mutex);
   sfi_msg_type_init_internals();
 }
 
@@ -174,7 +175,7 @@
   bool     need_unlock = FALSE;
   if (quark_log_handler)
     {
-      birnet_mutex_lock (&logging_mutex);
+      sfi_mutex_lock (&logging_mutex);
       need_unlock = TRUE;
     }
   /* allow duplicate registration */
@@ -184,7 +185,7 @@
       {
         /* found duplicate */
         if (need_unlock)
-          birnet_mutex_unlock (&logging_mutex);
+          sfi_mutex_unlock (&logging_mutex);
         return i;
       }
   /* add new message type */
@@ -201,7 +202,7 @@
       guint8 *old_msg_flags = sfi_msg_flags;
       /* we are holding a lock in the multi-threaded case so no need for compare_and_swap */
       typedef guint8* X;
-      birnet_atomic_pointer_set ((void*) &sfi_msg_flags, msg_flags);
+      sfi_atomic_pointer_set ((void*) &sfi_msg_flags, msg_flags);
       // FIXME: sfi_msg_flags should be registered as hazard pointer so we don't g_free() while other threads read old_msg_flags[*]
       g_free (old_msg_flags);
     }
@@ -209,10 +210,10 @@
   msg_types[mtype].label = g_strdup (label);
   sfi_msg_type_set (mtype, msg_types[default_ouput].log_flags, !msg_types[default_ouput].disabled);
   msg_types[mtype].default_type = default_ouput;
-  birnet_atomic_uint_set (&sfi_msg_flags_max, mtype); /* only ever grows */
+  sfi_atomic_uint_set (&sfi_msg_flags_max, mtype); /* only ever grows */
   /* out of here */
   if (need_unlock)
-    birnet_mutex_unlock (&logging_mutex);
+    sfi_mutex_unlock (&logging_mutex);
   return mtype;
 }
 
@@ -262,10 +263,10 @@
 void
 sfi_msg_allow (const char *key)
 {
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   if (key)
     key_list_change (key, TRUE);
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
   
 #if 0
   guint i;
@@ -280,28 +281,28 @@
 void
 sfi_msg_deny (const char *key)
 {
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   if (key)
     key_list_change (key, FALSE);
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
 }
 
 void
 sfi_msg_enable (SfiMsgType mtype)
 {
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   if (mtype > 1 && mtype < n_msg_types)
     sfi_msg_type_set (mtype, msg_types[mtype].log_flags, TRUE);
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
 }
 
 void
 sfi_msg_disable (SfiMsgType mtype)
 {
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   if (mtype > 1 && mtype < n_msg_types)
     sfi_msg_type_set (mtype, msg_types[mtype].log_flags, FALSE);
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
 }
 
 void
@@ -309,10 +310,10 @@
                            SfiMsgLogFlags    channel_mask,
                            const gchar         *dummy_filename)
 {
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   if (mtype > 1 && mtype < n_msg_types)
     sfi_msg_type_set (mtype, channel_mask, !msg_types[mtype].disabled);
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
 }
 
 void
@@ -320,7 +321,7 @@
                              const char       *stdlog_filename,
                              guint             syslog_priority) /* if != 0, stdlog to syslog */
 {
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   stdlog_to_stderr = stdlog_to_stderr_bool != 0;
   stdlog_syslog_priority = syslog_priority;
   if (stdlog_file && stdlog_file != stdout)
@@ -330,7 +331,7 @@
     stdlog_file = stdout;
   else if (stdlog_filename)
     stdlog_file = fopen (stdlog_filename, "a");
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
 }
 
 /**
@@ -345,10 +346,10 @@
 sfi_msg_type_ident (SfiMsgType mtype)
 {
   const gchar *string = NULL;
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   if (mtype >= 0 && mtype < n_msg_types)
     string = msg_types[mtype].ident;
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
   return string;
 }
 
@@ -365,10 +366,10 @@
 sfi_msg_type_label (SfiMsgType mtype)
 {
   const gchar *string = NULL;
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   if (mtype >= 0 && mtype < n_msg_types)
     string = msg_types[mtype].label;
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
   return string;
 }
 
@@ -386,13 +387,13 @@
 {
   g_return_val_if_fail (ident != NULL, 0);
   guint i;
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   for (i = 0; i < n_msg_types; i++)
     if (strcmp (ident, msg_types[i].ident) == 0)
       break;
   if (i >= n_msg_types)
     i = 0;
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
   return i;
 }
 
@@ -402,13 +403,13 @@
  * Set the handler function for messages logged in the current
  * thread. If NULL is specified as handler, the standard handler
  * will be used. For handler implementations that require an extra
- * data argument, see birnet_thread_set_qdata().
+ * data argument, see sfi_thread_set_qdata().
  * This function is MT-safe and may be called from any thread.
  */
 void
 sfi_msg_set_thread_handler (SfiMsgHandler handler)
 {
-  birnet_thread_set_qdata (quark_log_handler, handler);
+  sfi_thread_set_qdata (quark_log_handler, handler);
 }
 
 /**
@@ -505,7 +506,7 @@
   va_end (args);
   msg.config_check = NULL;
   /* handle message */
-  LogBit *lbit_list = birnet_thread_steal_qdata (quark_msg_bits);
+  LogBit *lbit_list = sfi_thread_steal_qdata (quark_msg_bits);
   sfi_log_msg_process (&msg);
   g_free (msg.primary);
   free_lbits (lbit_list); /* purge thread local msg bit list */
@@ -643,7 +644,7 @@
         msg_apply_bit (&msg, lbits[j]);
     }
   /* reset thread local msg bit list */
-  LogBit *lbit_list = birnet_thread_steal_qdata (quark_msg_bits);
+  LogBit *lbit_list = sfi_thread_steal_qdata (quark_msg_bits);
   /* handle message */
   if (!handler)
     handler = sfi_log_msg_process;
@@ -670,8 +671,8 @@
   lbit->bit.owner = owner;
   lbit->bit.data = data;
   lbit->data_free = data_free;
-  lbit->next = birnet_thread_steal_qdata (quark_msg_bits);
-  birnet_thread_set_qdata_full (quark_msg_bits, lbit, (GDestroyNotify) free_lbits);
+  lbit->next = sfi_thread_steal_qdata (quark_msg_bits);
+  sfi_thread_set_qdata_full (quark_msg_bits, lbit, (GDestroyNotify) free_lbits);
   errno = saved_errno;
   return &lbit->bit;
 }
@@ -740,11 +741,11 @@
 sfi_msg_type_actions (SfiMsgType mtype)
 {
   guint actions = 0;
-  birnet_mutex_lock (&logging_mutex);
+  sfi_mutex_lock (&logging_mutex);
   if (mtype >= 0 && mtype < n_msg_types &&
       !msg_types[mtype].disabled)
     actions = msg_types[mtype].log_flags;
-  birnet_mutex_unlock (&logging_mutex);
+  sfi_mutex_unlock (&logging_mutex);
   return actions;
 }
 
@@ -777,7 +778,7 @@
     {
       bool   is_debug = msg.type == SFI_MSG_DEBUG, is_diag = msg.type == SFI_MSG_DIAG;
       gchar *prefix = log_prefix (prgname (is_debug),                                   /* strip prgname path for debugging */
-                                  birnet_thread_self_pid(),                                /* always print pid */
+                                  sfi_thread_self_pid(),                                /* always print pid */
                                   is_debug ? NULL : msg.log_domain,                     /* print domain except when debugging */
                                   is_debug || is_diag ? NULL : label,                   /* print translated message type execpt for debug/diagnosis */
                                   is_debug ? ident : NULL);                             /* print identifier if debugging */
@@ -795,7 +796,7 @@
   if (stdlog_file && (actions & SFI_MSG_TO_STDLOG))
     {
       char *prefix = log_prefix (prgname (FALSE),                                       /* printf fully qualified program name */
-                                 birnet_thread_self_pid(),                                 /* always print pid */
+                                 sfi_thread_self_pid(),                                 /* always print pid */
                                  msg.log_domain,                                        /* always print log domain */
                                  NULL,                                                  /* skip translated message type */
                                  ident);                                                /* print machine readable message type */
@@ -812,7 +813,7 @@
   /* log to log handler */
   if (actions & SFI_MSG_TO_HANDLER)
     {
-      SfiMsgHandler log_handler = birnet_thread_get_qdata (quark_log_handler);
+      SfiMsgHandler log_handler = sfi_thread_get_qdata (quark_log_handler);
       if (!log_handler)
         log_handler = sfi_msg_default_handler;
       log_handler (&msg);

Modified: trunk/sfi/sfitypes.h
===================================================================
--- trunk/sfi/sfitypes.h	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/sfitypes.h	2006-10-07 18:50:38 UTC (rev 3941)
@@ -20,46 +20,12 @@
 #define __SFI_TYPES_H__
 
 #include <sfi/glib-extra.h>
-#include <birnet/birnetthread.h> /* include glib before birnet for G_LOG_DOMAIN */
+#include <sfi/sfiwrapper.h>
 
 G_BEGIN_DECLS
 
-/* --- common type definitions --- */
-typedef unsigned int          uint8       __attribute__ ((__mode__ (__QI__)));
-typedef unsigned int          uint16      __attribute__ ((__mode__ (__HI__)));
-typedef unsigned int          uint32      __attribute__ ((__mode__ (__SI__)));
-typedef unsigned int          uint64      __attribute__ ((__mode__ (__DI__)));
-// provided by Birnet:        uint;
-BIRNET_STATIC_ASSERT (sizeof (uint8)  == 1);
-BIRNET_STATIC_ASSERT (sizeof (uint16) == 2);
-BIRNET_STATIC_ASSERT (sizeof (uint32) == 4);
-BIRNET_STATIC_ASSERT (sizeof (uint64) == 8);
-typedef signed int            int8        __attribute__ ((__mode__ (__QI__)));
-typedef signed int            int16       __attribute__ ((__mode__ (__HI__)));
-typedef signed int            int32       __attribute__ ((__mode__ (__SI__)));
-typedef signed int            int64       __attribute__ ((__mode__ (__DI__)));
-// provided by compiler	      int;
-BIRNET_STATIC_ASSERT (sizeof (int8)  == 1);
-BIRNET_STATIC_ASSERT (sizeof (int16) == 2);
-BIRNET_STATIC_ASSERT (sizeof (int32) == 4);
-BIRNET_STATIC_ASSERT (sizeof (int64) == 8);
-typedef uint32                unichar;
-BIRNET_STATIC_ASSERT (sizeof (unichar) == 4);
-
-
-
 /* --- Sfi typedefs --- */
-
-/* 64 bit types - FIXME: assert in configure script that sizeof (long long) == 8 */
-typedef long long               sfi_int64;
-typedef unsigned long long      sfi_uint64;
-
-#if (1) /* internal: do not make these available when compiling third party code */
-#define int64                   sfi_int64
-#define uint64                  sfi_uint64
-#endif
-
-typedef gboolean		SfiBool;
+typedef bool			SfiBool;
 typedef gint			SfiInt;
 #define	SFI_MAXINT		(+2147483647)
 #define	SFI_MININT		(-SFI_MAXINT - 1)
@@ -68,7 +34,7 @@
 #define	SFI_MINNUM		(-SFI_MAXNUM - 1)
 typedef gint64			SfiTime;
 typedef SfiInt			SfiNote;
-typedef gdouble			SfiReal;
+typedef double			SfiReal;
 #define SFI_MINREAL		(2.2250738585072014e-308)	/* IEEE754 double */
 #define SFI_MAXREAL		(1.7976931348623157e+308)	/* IEEE754 double */
 typedef const gchar*		SfiChoice;

Modified: trunk/sfi/sfiwrapper.cc
===================================================================
--- trunk/sfi/sfiwrapper.cc	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/sfiwrapper.cc	2006-10-07 18:50:38 UTC (rev 3941)
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 #include "sfiwrapper.h"
+#undef BIRNET__RUNTIME_PROBLEM
 #include <birnet/birnet.hh>
 
 /* --- initialization --- */
@@ -51,19 +52,38 @@
   return Birnet::init_value_int ((BirnetInitValue*) value);
 }
 
+SfiInitSettings
+sfi_init_settings (void)
+{
+  return *::Birnet::birnet_init_settings;
+}
+
+/* --- CPU Info --- */
+SfiCPUInfo
+sfi_cpu_info (void)
+{
+  return ::Birnet::cpu_info();
+}
+
+gchar*
+sfi_cpu_info_string (const SfiCPUInfo *cpu_info)
+{
+  return g_strdup (::Birnet::cpu_info_string (*cpu_info).c_str());
+}
+
 /* --- file testing --- */
 bool
 birnet_file_check (const char *file,
                    const char *mode)
 {
-  return Birnet::Path::check (file, mode);
+  return Birnet::Path::check (file ? file : "", mode ? mode : "");
 }
 
 bool
 birnet_file_equals (const char *file1,
                     const char *file2)
 {
-  return Birnet::Path::equals (file1, file2);
+  return Birnet::Path::equals (file1 ? file1 : "", file2 ? file2 : "");
 }
 
 /* --- url handling --- */
@@ -102,4 +122,41 @@
   return Birnet::cleanup_force_handlers();
 }
 
+/* --- threading API --- */
+SfiThread*
+sfi_thread_run (const gchar  *name,
+                SfiThreadFunc func,
+                gpointer      user_data)
+{
+  g_return_val_if_fail (name && name[0], NULL);
+  
+  SfiThread *thread = sfi_thread_new (name);
+  sfi_thread_ref_sink (thread);
+  if (sfi_thread_start (thread, func, user_data))
+    return thread;
+  else
+    {
+      sfi_thread_unref (thread);
+      return NULL;
+    }
+}
+
+/* for the sfi_thread_table initialization to work, Birnet::ThreadTable must not be a reference */
+extern "C" const BirnetThreadTable *sfi_thread_table = &::Birnet::ThreadTable;
+
+void
+sfi_runtime_problem (char        ewran_tag,
+                     const char *domain,
+                     const char *file,
+                     int         line,
+                     const char *funcname,
+                     const char *msgformat,
+                     ...)
+{
+  va_list args;
+  va_start (args, msgformat);
+  ::Birnet::birnet_runtime_problemv (ewran_tag, domain, file, line, funcname, msgformat, args);
+  va_end (args);
+}
+
 /* vim:set ts=8 sts=2 sw=2: */

Modified: trunk/sfi/sfiwrapper.h
===================================================================
--- trunk/sfi/sfiwrapper.h	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/sfiwrapper.h	2006-10-07 18:50:38 UTC (rev 3941)
@@ -19,7 +19,10 @@
 #ifndef __SFI_WRAPPER_H__
 #define __SFI_WRAPPER_H__
 
+#include <stdbool.h>
 #include <sfi/sfitypes.h>
+#include <sfi/glib-extra.h>
+#include <birnet/birnetcdefs.h> /* include glib before birnet for G_LOG_DOMAIN */
 
 /* sfiwrapper.h is a thin C language wrapper around C++ features
  * provided by libbirnet.
@@ -27,6 +30,17 @@
 
 BIRNET_EXTERN_C_BEGIN();
 
+/* --- short integer types --- */
+typedef BirnetUInt8   uint8;
+typedef BirnetUInt16  uint16;
+typedef BirnetUInt32  uint32;
+typedef BirnetUInt64  uint64;
+typedef BirnetInt8    int8;
+typedef BirnetInt16   int16;
+typedef BirnetInt32   int32;
+typedef BirnetInt64   int64;
+typedef BirnetUnichar unichar;
+
 /* --- initialization --- */
 typedef struct
 {
@@ -42,6 +56,15 @@
 double  sfi_init_value_double (SfiInitValue *value);
 gint64  sfi_init_value_int    (SfiInitValue *value);
 
+typedef BirnetInitSettings SfiInitSettings;
+SfiInitSettings sfi_init_settings (void);
+
+/* --- CPU Info --- */
+typedef BirnetCPUInfo SfiCPUInfo;
+
+SfiCPUInfo sfi_cpu_info	   (void);
+gchar*     sfi_cpu_info_string (const SfiCPUInfo *cpu_info);
+
 /* --- file tests --- */
 bool	birnet_file_check (const char *file,
 			   const char *mode);
@@ -59,8 +82,118 @@
 					 const char           *cookie);
 
 /* --- cleanup handlers --- */
-void birnet_cleanup_force_handlers     (void); // FIXME: remove 
+void birnet_cleanup_force_handlers     (void); // FIXME: remove
 
+/* --- threading API --- */
+typedef BirnetThread   		SfiThread;
+typedef void         	      (*SfiThreadFunc)   (void *user_data);
+typedef void         	      (*SfiThreadWakeup) (void *wakeup_data);
+typedef BirnetCond     		SfiCond;
+typedef BirnetMutex    		SfiMutex;
+typedef BirnetRecMutex 		SfiRecMutex;
+typedef BirnetThreadState       SfiThreadState;
+typedef BirnetThreadInfo        SfiThreadInfo;
+#define SFI_THREAD_UNKNOWN      BIRNET_THREAD_UNKNOWN
+#define SFI_THREAD_RUNNING      BIRNET_THREAD_RUNNING
+#define SFI_THREAD_SLEEPING     BIRNET_THREAD_SLEEPING
+#define SFI_THREAD_DISKWAIT     BIRNET_THREAD_DISKWAIT
+#define SFI_THREAD_TRACED       BIRNET_THREAD_TRACED
+#define SFI_THREAD_PAGING       BIRNET_THREAD_PAGING
+#define SFI_THREAD_ZOMBIE       BIRNET_THREAD_ZOMBIE
+#define SFI_THREAD_DEAD         BIRNET_THREAD_DEAD
+SfiThread* sfi_thread_run			(const gchar  *name, /* new + start */
+						 SfiThreadFunc func,
+						 gpointer      user_data);
+#define	SFI_MUTEX_DECLARE_INITIALIZED(name)	SFI_MUTEX__DECLARE_INITIALIZED (name)
+#define sfi_mutex_init(mtx)        		(sfi_thread_table->mutex_init (mtx))
+#define sfi_mutex_lock(mtx)        		(sfi_thread_table->mutex_lock (mtx))
+#define sfi_mutex_trylock(mtx)     		(0 == sfi_thread_table->mutex_trylock (mtx))
+#define sfi_mutex_unlock(mtx)      		(sfi_thread_table->mutex_unlock (mtx))
+#define sfi_mutex_destroy(mtx)     		(sfi_thread_table->mutex_destroy (mtx))
+#define	SFI_REC_MUTEX_DECLARE_INITIALIZED(name)	SFI_REC_MUTEX__DECLARE_INITIALIZED (name)
+#define sfi_rec_mutex_init(mtx)    		(sfi_thread_table->rec_mutex_init (mtx))
+#define sfi_rec_mutex_lock(mtx)    		(sfi_thread_table->rec_mutex_lock (mtx))
+#define sfi_rec_mutex_trylock(mtx) 		(0 == sfi_thread_table->rec_mutex_trylock (mtx))
+#define sfi_rec_mutex_unlock(mtx)  		(sfi_thread_table->rec_mutex_unlock (mtx))
+#define sfi_rec_mutex_destroy(mtx) 		(sfi_thread_table->rec_mutex_destroy (mtx))
+#define	SFI_COND_DECLARE_INITIALIZED(name)	SFI_COND__DECLARE_INITIALIZED (name)
+#define sfi_cond_init(cond)  			(sfi_thread_table->cond_init (cond))
+#define sfi_cond_signal(cond)			(sfi_thread_table->cond_signal (cond))
+#define sfi_cond_broadcast(cond)		(sfi_thread_table->cond_broadcast (cond))
+#define sfi_cond_wait(cond,mtx)			(sfi_thread_table->cond_wait (cond, mtx))
+#define sfi_cond_wait_timed(cond,mtx,usecs)	(sfi_thread_table->cond_wait_timed (cond, mtx, usecs))
+#define sfi_cond_destroy(cond)			(sfi_thread_table->cond_destroy (cond))
+#define sfi_thread_new(name)            	(sfi_thread_table->thread_new (name))
+#define sfi_thread_ref(thrd)			(sfi_thread_table->thread_ref (thrd))
+#define sfi_thread_ref_sink(thrd)		(sfi_thread_table->thread_ref_sink (thrd))
+#define sfi_thread_unref(thrd)			(sfi_thread_table->thread_unref (thrd))
+#define sfi_thread_start(thrd,func,udata)	(sfi_thread_table->thread_start (thrd, func, udata))
+#define sfi_thread_self()			(sfi_thread_table->thread_self ())
+#define sfi_thread_self_pid()			(sfi_thread_table->thread_pid (sfi_thread_self()))
+#define sfi_thread_get_pid(thrd)		(sfi_thread_table->thread_pid (thrd))
+#define sfi_thread_get_name(thrd)		(sfi_thread_table->thread_name (thrd))
+#define sfi_thread_set_name(name)		(sfi_thread_table->thread_set_name (name))
+#define sfi_thread_sleep(usecs)			(sfi_thread_table->thread_sleep (usecs))
+#define sfi_thread_wakeup(thrd)			(sfi_thread_table->thread_wakeup (thrd))
+#define sfi_thread_awake_after(stamp)		(sfi_thread_table->thread_awake_after (stamp))
+#define sfi_thread_emit_wakeups(stamp)		(sfi_thread_table->thread_emit_wakeups (stamp))
+#define sfi_thread_set_wakeup(func,udata,dstry)	(sfi_thread_table->thread_set_wakeup (func, udata, dstry))
+#define sfi_thread_abort(thrd)			(sfi_thread_table->thread_abort (thrd))
+#define sfi_thread_queue_abort(thrd)		(sfi_thread_table->thread_queue_abort (thrd))
+#define sfi_thread_aborted()			(sfi_thread_table->thread_aborted ())
+#define sfi_thread_get_aborted(thrd)		(sfi_thread_table->thread_get_aborted (thrd))
+#define sfi_thread_get_running(thrd)		(sfi_thread_table->thread_get_running (thrd))
+#define sfi_thread_wait_for_exit(thrd)		(sfi_thread_table->thread_wait_for_exit (thrd))
+#define sfi_thread_yield()			(sfi_thread_table->thread_yield ())
+#define sfi_thread_info_collect(thrd)		(sfi_thread_table->info_collect (thrd))
+#define sfi_thread_info_free(tinfo)		(sfi_thread_table->info_free (tinfo))
+#define	sfi_thread_get_qdata(quark)		(sfi_thread_table->qdata_get (quark))
+#define	sfi_thread_set_qdata_full(q,udat,dstry)	(sfi_thread_table->qdata_set (q, udat, dstry))
+#define	sfi_thread_set_qdata(quark,udata)	(sfi_thread_table->qdata_set (quark, udata, NULL))
+#define	sfi_thread_steal_qdata(quark)		(sfi_thread_table->qdata_steal (quark))
+#define sfi_atomic_pointer_set(atmc,val)	(sfi_thread_table->atomic_pointer_set (atmc, val))
+#define sfi_atomic_pointer_get(atmc)		(sfi_thread_table->atomic_pointer_get (atmc))
+#define sfi_atomic_pointer_cas(atmc,oval,nval)	(sfi_thread_table->atomic_pointer_cas (atmc, oval, nval))
+#define sfi_atomic_int_set(atmc,val)		(sfi_thread_table->atomic_int_set (atmc, val))
+#define sfi_atomic_int_get(atmc)		(sfi_thread_table->atomic_int_get (atmc))
+#define sfi_atomic_int_cas(atmc,oval,nval)	(sfi_thread_table->atomic_int_cas (atmc, oval, nval))
+#define sfi_atomic_int_add(atmc,diff)		(sfi_thread_table->atomic_int_add (atmc, diff))
+#define sfi_atomic_int_swap_add(atmc,diff)	(sfi_thread_table->atomic_int_swap_add (atmc, diff))
+#define sfi_atomic_uint_set(atmc,val)		(sfi_thread_table->atomic_uint_set (atmc, val))
+#define sfi_atomic_uint_get(atmc)		(sfi_thread_table->atomic_uint_get (atmc))
+#define sfi_atomic_uint_cas(atmc,oval,nval)	(sfi_thread_table->atomic_uint_cas (atmc, oval, nval))
+#define sfi_atomic_uint_add(atmc,diff)		(sfi_thread_table->atomic_uint_add (atmc, diff))
+#define sfi_atomic_uint_swap_add(atmc,diff)	(sfi_thread_table->atomic_uint_swap_add (atmc, diff))
+
+/* --- implementation bits --- */
+extern const BirnetThreadTable *sfi_thread_table;
+#define SFI_MUTEX__DECLARE_INITIALIZED(mutexname)                        	\
+  SfiMutex mutexname = { 0 };                                                	\
+  static void BIRNET_CONSTRUCTOR                                                \
+  BIRNET_CPP_PASTE4 (__sfi_mutex__autoinit, __LINE__, __, mutexname) (void)  	\
+  { sfi_thread_table->mutex_chain4init (&mutexname); }
+#define SFI_REC_MUTEX__DECLARE_INITIALIZED(recmtx)                            	\
+  SfiRecMutex recmtx = { { 0 } };                                            	\
+  static void BIRNET_CONSTRUCTOR                                                \
+  BIRNET_CPP_PASTE4 (__sfi_rec_mutex__autoinit, __LINE__, __, recmtx) (void) 	\
+  { sfi_thread_table->rec_mutex_chain4init (&recmtx); }
+#define SFI_COND__DECLARE_INITIALIZED(condname)                               	\
+  SfiCond condname = { 0 };                                                  	\
+  static void BIRNET_CONSTRUCTOR                                                \
+  BIRNET_CPP_PASTE4 (__sfi_cond__autoinit, __LINE__, __, condname) (void)    	\
+  { sfi_thread_table->cond_chain4init (&condname); }
+#ifndef BIRNET__RUNTIME_PROBLEM
+#define BIRNET__RUNTIME_PROBLEM(ErrorWarningReturnAssertNotreach,domain,file,line,funcname,...) \
+        sfi_runtime_problem (ErrorWarningReturnAssertNotreach, domain, file, line, funcname, __VA_ARGS__)
+#endif
+void sfi_runtime_problem (char        ewran_tag,
+			  const char *domain,
+			  const char *file,
+			  int         line,
+			  const char *funcname,
+			  const char *msgformat,
+			  ...) BIRNET_PRINTF (6, 7);
+
 BIRNET_EXTERN_C_END();
 
 #endif /* __SFI_WRAPPER_H__ */

Modified: trunk/sfi/tests/misctests.c
===================================================================
--- trunk/sfi/tests/misctests.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/sfi/tests/misctests.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -20,12 +20,11 @@
 #define  G_LOG_DOMAIN __FILE__
 // #define TEST_VERBOSE
 #include <birnet/birnettests.h>
-#include <sfi/sfi.h>
+#include <sfi/sfitests.h>
 #include <unistd.h>
 #include <string.h>
 #include <signal.h>	/* G_BREAKPOINT() */
 
-
 /* provide IDL type initializers */
 #define sfidl_pspec_Real(group, name, nick, blurb, dflt, min, max, step, hints)  \
   sfi_pspec_real (name, nick, blurb, dflt, min, max, step, hints)
@@ -154,10 +153,10 @@
 test_thread (gpointer data)
 {
   guint *tdata = data;
-  birnet_thread_sleep (-1);
+  sfi_thread_sleep (-1);
   *tdata += 1;
-  while (!birnet_thread_aborted ())
-    birnet_thread_sleep (-1);
+  while (!sfi_thread_aborted ())
+    sfi_thread_sleep (-1);
   TACK ();
 }
 
@@ -169,18 +168,18 @@
   BirnetThread *thread;
   gboolean locked;
   TSTART ("Threading");
-  birnet_mutex_init (&test_mutex);
-  locked = birnet_mutex_trylock (&test_mutex);
+  sfi_mutex_init (&test_mutex);
+  locked = sfi_mutex_trylock (&test_mutex);
   TASSERT (locked);
-  birnet_mutex_unlock (&test_mutex);
-  birnet_mutex_destroy (&test_mutex);
-  thread = birnet_thread_run ("sfi-test-thread", test_thread, &thread_data);
+  sfi_mutex_unlock (&test_mutex);
+  sfi_mutex_destroy (&test_mutex);
+  thread = sfi_thread_run ("sfi-test-thread", test_thread, &thread_data);
   TASSERT (thread != NULL);
   TASSERT (thread_data == 0);
-  birnet_thread_wakeup (thread);
-  birnet_thread_abort (thread);
+  sfi_thread_wakeup (thread);
+  sfi_thread_abort (thread);
   TASSERT (thread_data > 0);
-  birnet_thread_unref (thread);
+  sfi_thread_unref (thread);
   TDONE ();
 }
 
@@ -557,7 +556,94 @@
   TDONE ();
 }
 
+static SFI_MUTEX_DECLARE_INITIALIZED (test_mutex);
+static SFI_REC_MUTEX_DECLARE_INITIALIZED (test_rec_mutex);
+static SFI_COND_DECLARE_INITIALIZED (test_cond);
+
 static void
+check_thread_wrapper_compilation (void)
+{
+  return;
+  /* this code doesn't need to run, just to compile */
+  BirnetMutex *mtx = NULL;
+  BirnetRecMutex *rmtx = NULL;
+  BirnetCond *cond = NULL;
+  BirnetInt64 usecs = 27;
+  bool boolv;
+  sfi_mutex_init (mtx);
+  sfi_mutex_lock (mtx);
+  boolv = sfi_mutex_trylock (mtx);
+  sfi_mutex_unlock (mtx);
+  sfi_mutex_destroy (mtx);
+  sfi_rec_mutex_init (rmtx);
+  sfi_rec_mutex_lock (rmtx);
+  boolv = sfi_rec_mutex_trylock (rmtx);
+  sfi_rec_mutex_unlock (rmtx);
+  sfi_rec_mutex_destroy (rmtx);
+  sfi_cond_init (cond);
+  sfi_cond_signal (cond);
+  sfi_cond_broadcast (cond);
+  sfi_cond_wait (cond, mtx);
+  sfi_cond_wait_timed (cond, mtx, usecs);
+  sfi_cond_destroy (cond);
+  BirnetThread *thrd = NULL;
+  const char *name = NULL;
+  void *udata = NULL;
+  BirnetThreadFunc thread_func = NULL;
+  BirnetThreadWakeup wakeup_func = NULL;
+  GDestroyNotify dstry = NULL;
+  int pid;
+  BirnetInt64 stamp = 31;
+  BirnetThreadInfo *tinfo;
+  thrd = sfi_thread_new (name);
+  thrd = sfi_thread_ref (thrd);
+  thrd = sfi_thread_ref_sink (thrd);
+  sfi_thread_unref (thrd);
+  sfi_thread_start (thrd, thread_func, udata);
+  thrd = sfi_thread_self ();
+  pid = sfi_thread_self_pid ();
+  pid = sfi_thread_get_pid (thrd);
+  name = sfi_thread_get_name (thrd);
+  sfi_thread_set_name (name);
+  sfi_thread_sleep (usecs);
+  sfi_thread_wakeup (thrd);
+  sfi_thread_awake_after (stamp);
+  sfi_thread_emit_wakeups (stamp);
+  sfi_thread_set_wakeup (wakeup_func, udata, dstry);
+  sfi_thread_abort (thrd);
+  sfi_thread_queue_abort (thrd);
+  boolv = sfi_thread_aborted ();
+  boolv = sfi_thread_get_aborted (thrd);
+  boolv = sfi_thread_get_running (thrd);
+  sfi_thread_wait_for_exit (thrd);
+  sfi_thread_yield ();
+  tinfo = sfi_thread_info_collect (thrd);
+  sfi_thread_info_free (tinfo);
+  GQuark quark = 0;
+  udata = sfi_thread_get_qdata (quark);
+  sfi_thread_set_qdata_full (quark, udata, dstry);
+  sfi_thread_set_qdata (quark, udata);
+  udata = sfi_thread_steal_qdata (quark);
+  int diff = +17;
+  volatile int  iatmc, ival = 3, ioval = 4, inval = 5;
+  volatile uint uatmc, uval = 3, uoval = 4, unval = 5;
+  volatile void *patmc, *pval = (void*) 1, *poval = (void*) 2, *pnval = (void*) 3;
+  sfi_atomic_pointer_set (&patmc, pval);
+  pval = sfi_atomic_pointer_get (&patmc);
+  boolv = sfi_atomic_pointer_cas (&patmc, poval, pnval);
+  sfi_atomic_int_set (&iatmc, ival);
+  ival = sfi_atomic_int_get (&iatmc);
+  boolv = sfi_atomic_int_cas (&iatmc, ioval, inval);
+  sfi_atomic_int_add (&iatmc, diff);
+  ival = sfi_atomic_int_swap_add (&iatmc, diff);
+  sfi_atomic_uint_set (&uatmc, uval);
+  uval = sfi_atomic_uint_get (&uatmc);
+  boolv = sfi_atomic_uint_cas (&uatmc, uoval, unval);
+  sfi_atomic_uint_add (&uatmc, diff);
+  uval = sfi_atomic_uint_swap_add (&uatmc, diff);
+}
+
+static void
 test_renames (void)
 {
   gchar *str;
@@ -822,8 +908,7 @@
 main (int   argc,
       char *argv[])
 {
-  g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL);
-  birnet_init (&argc, &argv, NULL);
+  sfi_init_test (&argc, &argv, NULL);
   
   test_types_init ();
 
@@ -832,7 +917,8 @@
       generate_vmarshal_code ();
       return 0;
     }
-  
+
+  check_thread_wrapper_compilation ();
   test_notes ();
   test_time ();
   test_renames ();

Modified: trunk/shell/bsescm.c
===================================================================
--- trunk/shell/bsescm.c	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/shell/bsescm.c	2006-10-07 18:50:38 UTC (rev 3941)
@@ -67,7 +67,7 @@
 {
   const gchar *env_str;
 
-  birnet_init (&argc, &argv, "BSESCM");
+  sfi_init (&argc, &argv, "BSESCM", NULL);
   bse_init_textdomain_only();
   setlocale (LC_ALL, "");
 

Modified: trunk/tests/bse/cxxbinding.cc
===================================================================
--- trunk/tests/bse/cxxbinding.cc	2006-10-07 18:32:35 UTC (rev 3940)
+++ trunk/tests/bse/cxxbinding.cc	2006-10-07 18:50:38 UTC (rev 3941)
@@ -35,7 +35,9 @@
     seconds = sleep (seconds);
 }
 
-int main(int argc, char **argv)
+int
+main (int   argc,
+      char *argv[])
 {
   std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
   bse_init_async (&argc, &argv, "CxxBindingTest", NULL);




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]