FreeRDP/winpr/libwinpr/pool/test/TestPoolWork.c

29 lines
509 B
C
Raw Normal View History

2013-01-21 06:15:55 +04:00
#include <winpr/crt.h>
#include <winpr/pool.h>
void test_WorkCallback(PTP_CALLBACK_INSTANCE instance, void* context, PTP_WORK work)
{
printf("Hello %s", context);
}
int TestPoolWork(int argc, char* argv[])
{
TP_WORK * work;
work = CreateThreadpoolWork((PTP_WORK_CALLBACK) test_WorkCallback, "world", NULL);
2013-01-21 06:15:55 +04:00
if (!work)
{
printf("CreateThreadpoolWork failure\n");
return -1;
}
SubmitThreadpoolWork(work);
WaitForThreadpoolWorkCallbacks(work, FALSE);
CloseThreadpoolWork(work);
return 0;
}