Use the presence of SIGALRM in the signal mask to detect whether the task is inside a critical section. Previously this was done by comparing the entire 'omask' with 'allsigs'. This was dubious for a couple of reasons: - the compiler is free to add pad bytes between structure members and   not initialize them. - the OS is required to initialize only those signals that are actually   implemented.
Use the presence of SIGALRM in the signal mask to detect whether the task
is inside a critical section. Previously this was done by comparing the
entire 'omask' with 'allsigs'. This was dubious for a couple of reasons:
- the compiler is free to add pad bytes between structure members and
  not initialize them.
- the OS is required to initialize only those signals that are actually
  implemented.

Since we enable/disable all signals in 'allsigs' simultaneously, testing
the presence of any one signal is sufficient to test all of them.

Set the SA_RESTART flag when registering a signal handler otherwise a
'write()' to the uart can fail with errno set to EINTR causing the
'uart_poller' task to assert.

Initialize signals in 'os_arch_os_init()' so critical sections start
functioning before they are used during task initialization.

andrzej-kaczmarek/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,wes3/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,wes3/incubator-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,IMGJulian/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,wes3/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,wes3/incubator-mynewt-core,IMGJulian/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,IMGJulian/incubator-mynewt-core