/*
  thread.cpp test file.  Compile with:
  g++ thread.cpp -o thread -std=c++0x `pkg-config --cflags --libs glibmm-2.4`
*/

#include <iostream>
#include <functional>

#include <sigc++/sigc++.h>
#include <glibmm/init.h>
#include <glibmm/threads.h>

class Test: public sigc::trackable {
  int a;
public:
  void non_static_func() {std::cout << "In non_static_func" << std::endl;}
  static void static_func() {std::cout << "In static_func" << std::endl;}
  Test(): a(0) {}
};

int main() {

  Test test;

  Glib::init();

  auto t1 = Glib::Threads::Thread::create(std::bind(&Test::non_static_func, &test));
  auto t2 = Glib::Threads::Thread::create(sigc::ptr_fun(&Test::static_func));

  t1->join();
  t2->join();
}
