#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <BThread.h>

class Thread : public BThread{
public:
	void*	function(){
			while(1){
				printf("Thread Running\n");
				sleep(1);
			}
			return 0;
		}
};

int main(){
	Thread		t;
	void*		r;

	t.start();
	
	sleep(5);
	
	t.cancel();
	r = t.waitForCompletion();
	printf("Result: %p %s\n", r, strerror(errno));
	
	sleep(10);

	return 0;
}
