On Wed, Feb 26, 2014 at 11:24 AM, Ben Pfaff <b...@nicira.com> wrote:
> On Wed, Feb 26, 2014 at 10:51:56AM -0800, Gurucharan Shetty wrote:
>> Windows does not have a SIGHUP or SIGALRM. It does have
>> a SIGINT and SIGTERM. The documentation at msdn says that
>> SIGINT is not supported for win32 applications because
>> WIN32 operating systems generate a new thread to specifically
>> handle Ctrl+C.
>>
>> This commit handles SIGTERM for Windows. The documentation also
>> states that nothing generates SIGTERM in Windows, but one can
>> use raise(SIGTERM) to manage it. The idea for handling SIGTERM
>> for Windows is to just have a place holder if there is need to
>> raise() a signal for some other purpose.
>>
>> We use SIGALRM in timeval.c if we wake up from a sleep after
>> 'deadline'. For Windows, print an error message and then
>> use SIGTERM.
>>
>> There is an atexit() function for Windows, so we can call cleanup
>> functions during exit.
>>
>> An upcoming commit separately handles Ctrl+C so that we can call
>> clean up functions for that use case.
>>
>> Signed-off-by: Gurucharan Shetty <gshe...@nicira.com>
>
> Was the VLOG_ERR in time_poll() added as part of debugging, or do you
> really want it to be part of the tree?
I kept it intentionally. I was not sure how to differentiate between termination
due to SIGALRM vs a termination due to SIGTERM. As of now, it probably
does not make sense as the only known way of termination because of SIGTERM
is because we woke up after the 'deadline' in WaitforMultipleObjects().

>
> Acked-by: Ben Pfaff <b...@nicira.com>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to