#include <glib.h>
#include <stdlib.h>

GMutex mutex;

gpointer
the_thread (gpointer data)
{
  gboolean *done = data;

  g_mutex_lock (&mutex);
  *done = TRUE;
  g_mutex_unlock (&mutex);
  return NULL;
}
  

int
main (int argc, char **argv)
{
  // volatile
  gboolean done = FALSE;
  int i;

  g_thread_new (NULL, the_thread, (gpointer)&done);

  while (!done) {
    for (i = 0; i < 100000; i++)
      ;
    // getenv ("FOO");
  }

  return 0;
}
