Rewrite the POSIX timer functions.
This is a much simpler implementation that lets the kernel do as much as possible. Co-authored-by: Jörgen Strand <jorgen.strand@sonymobile.com> Co-authored-by: Snild Dolkow <snild.dolkow@sonymobile.com> Change-Id: Iad19f155de977667aea09410266d54e63e8a26bf
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ScopedSignalHandler.h"
|
||||
|
||||
TEST(pthread, pthread_key_create) {
|
||||
pthread_key_t key;
|
||||
ASSERT_EQ(0, pthread_key_create(&key, NULL));
|
||||
@@ -337,14 +339,8 @@ static void pthread_kill__in_signal_handler_helper(int signal_number) {
|
||||
}
|
||||
|
||||
TEST(pthread, pthread_kill__in_signal_handler) {
|
||||
struct sigaction action;
|
||||
struct sigaction original_action;
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_flags = 0;
|
||||
action.sa_handler = pthread_kill__in_signal_handler_helper;
|
||||
ASSERT_EQ(0, sigaction(SIGALRM, &action, &original_action));
|
||||
ScopedSignalHandler ssh(SIGALRM, pthread_kill__in_signal_handler_helper);
|
||||
ASSERT_EQ(0, pthread_kill(pthread_self(), SIGALRM));
|
||||
ASSERT_EQ(0, sigaction(SIGALRM, &original_action, NULL));
|
||||
}
|
||||
|
||||
TEST(pthread, pthread_detach__no_such_thread) {
|
||||
|
Reference in New Issue
Block a user