Fix pthread & lrmi segfault issue. ("Oleg I. Vdovikin" <vdovikin@jscc.ru>)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11435 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ranma 2003-11-11 10:39:36 +00:00
parent dadd9e6b75
commit 95e49827fd
1 changed files with 8 additions and 0 deletions

View File

@ -11,6 +11,7 @@ This software has NO WARRANTY. Use it at your own risk.
Original location: http://cvs.debian.org/lrmi/
*/
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <sys/io.h>
@ -789,10 +790,17 @@ static int
run_vm86(void)
{
unsigned int vret;
sigset_t allsigs, cursigs;
unsigned long oldgs;
while (1)
{
sigfillset(&allsigs);
sigprocmask(SIG_SETMASK, &allsigs, &cursigs);
asm volatile ("movl %%gs, %0" : "=g" (oldgs));
vret = lrmi_vm86(&context.vm);
asm volatile ("movl %0, %%gs" :: "g" (oldgs));
sigprocmask(SIG_SETMASK, &cursigs, NULL);
if (VM86_TYPE(vret) == VM86_INTx)
{