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;
|
|
|
|
|
2013-01-21 07:39:32 +04:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|