X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Freentrant.cpp;h=c08df62681782611bb14cadcf4950e6ecffafa20;hp=bb9420a4db0d118d5f0937d09cb6289a7d6a0f37;hb=d55e0d0f9f17e1706e9751b7e920479f31370f51;hpb=ced847b29c9d6a123b08a743b5b542985f73b585 diff --git a/test/reentrant.cpp b/test/reentrant.cpp index bb9420a..c08df62 100644 --- a/test/reentrant.cpp +++ b/test/reentrant.cpp @@ -38,7 +38,7 @@ using namespace libt2n; namespace { -command_server *global_server; +command_server *global_server = NULL; string testfunc(const string& str) { @@ -46,7 +46,8 @@ string testfunc(const string& str) ret=str+", testfunc() was here"; // call handle, eventually reentrant - global_server->handle(1000); + if (global_server) + global_server->handle(1000); return ret; } @@ -146,7 +147,7 @@ class test_reentrant : public TestFixture // child { // wait till server is up - sleep(1); + sleep(3); // we want 8 identical childs hammering the server fork(); @@ -182,6 +183,8 @@ class test_reentrant : public TestFixture long long maxtime=5000000; while(maxtime > 0) cs.handle(maxtime,&maxtime); + + global_server = NULL; } // we are still alive, everything is ok