Skip to content
Snippets Groups Projects
Commit dc31ed13 authored by Cervantes Yu's avatar Cervantes Yu
Browse files

Bug 741272 - Implement raise() using pthread_kill() so the signal will be sent...

Bug 741272 - Implement raise() using pthread_kill() so the signal will be sent to the the caller thread instead of a random thread in the thread group. r=blassey,khuey
parent 6bd5741d
No related branches found
No related tags found
No related merge requests found
......@@ -7230,7 +7230,7 @@ if test "$OS_TARGET" = Android; then
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
fi
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise"
fi
dnl ========================================================
......
......@@ -49,6 +49,7 @@
#include <sys/mman.h>
#include <sys/limits.h>
#include <errno.h>
#include <pthread.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -1082,3 +1083,10 @@ __wrap_fork(void)
}
return pid;
}
extern "C" NS_EXPORT int
__wrap_raise(int sig)
{
return pthread_kill(pthread_self(), sig);
}
......@@ -4,6 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <unistd.h>
#include <pthread.h>
#include <vector>
#define NS_EXPORT __attribute__ ((visibility("default")))
......@@ -51,3 +52,10 @@ __wrap_fork(void)
}
return pid;
}
extern "C" NS_EXPORT int
__wrap_raise(int sig)
{
return pthread_kill(pthread_self(), sig);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment