Displaying 2 results from an estimated 2 matches for "threadproc".
2005 Nov 26
1
Another patch of win32-service for nice startup.
...BJECT_0)
+ break;
+
+ SetTheServiceStatus(SERVICE_START_PENDING, 0, i, 1000);
+ }
+
// The service has started.
SetTheServiceStatus(SERVICE_RUNNING, NO_ERROR, 0, 0);
@@ -241,9 +252,9 @@
}
#endif
- // Create Thread for service main
- hThread = CreateThread(NULL,0,ThreadProc,0,0,&ThreadId);
- if(hThread == INVALID_HANDLE_VALUE){
+ // Create the event to signal the service to start.
+ hStartEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if(hStartEvent == NULL){
strcpy(error,ErrorDescription(GetLastError()));
ErrorStopService();
r...
2006 Dec 07
0
Fwd: win32-service problems with patch
...anything needs to be done.
I have not tried this code with any other win32-service app (rails,
etc.) so I don''t know how they''ll work with this.
The basic flow is now:
Thread 1 Thread 2 "Green
Thread"
service_init
start ThreadProc
wait for hStart, or Thread 2 Exit Startup and set hStart
wait for hStop
start green thread wait for hStop wait
for hStop && normal processing
service_main wait for hStop wait
for hSto...