devdraw: more fixes (thanks David Jeannot)
This commit is contained in:
parent
210d461c87
commit
d0a596c5c8
5 changed files with 372 additions and 313 deletions
|
|
@ -33,7 +33,7 @@ See
|
||||||
.IR getsnarf (3)
|
.IR getsnarf (3)
|
||||||
for more details.
|
for more details.
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B \*9/src/cmd/snarfer.c
|
.B \*9/src/cmd/snarfer
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
Unix's \fIxclipboard\fR(1),
|
Unix's \fIxclipboard\fR(1),
|
||||||
.IR getsnarf (3)
|
.IR getsnarf (3)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -78,8 +78,6 @@ servep9p(void)
|
||||||
|
|
||||||
fmtinstall('W', drawfcallfmt);
|
fmtinstall('W', drawfcallfmt);
|
||||||
|
|
||||||
// notify(bell);
|
|
||||||
|
|
||||||
mbuf = nil;
|
mbuf = nil;
|
||||||
nmbuf = 0;
|
nmbuf = 0;
|
||||||
while((n = read(3, buf, 4)) == 4){
|
while((n = read(3, buf, 4)) == 4){
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
#include "cocoa-thread.h"
|
#include "cocoa-thread.h"
|
||||||
|
|
||||||
|
#ifndef TRY_LIBTHREAD
|
||||||
|
|
||||||
static pthread_mutex_t initlock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t initlock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -23,3 +25,4 @@ qunlock(QLock *q)
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&q->m);
|
pthread_mutex_unlock(&q->m);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,33 @@
|
||||||
#define QLock DQLock
|
/*
|
||||||
#define qlock dqlock
|
* I am too ignorant to know if Cocoa and Libthread
|
||||||
#define qunlock dqunlock
|
* can coexist: if I try to include thread.h, now
|
||||||
|
* that Devdraw uses Cocoa's threads (and timers), it
|
||||||
|
* crashes immediately; when Devdraw was using
|
||||||
|
* proccreate(), it could run a little while before to
|
||||||
|
* crash; the origin of those crashes is hard to
|
||||||
|
* ascertain, because other programs using Libthread
|
||||||
|
* (such as 9term, Acme, Plumber, and Sam) currently
|
||||||
|
* don't run when compiled with Xcode 4.1.
|
||||||
|
*/
|
||||||
|
//#define TRY_LIBTHREAD
|
||||||
|
|
||||||
typedef struct QLock QLock;
|
#ifdef TRY_LIBTHREAD
|
||||||
|
#include <thread.h>
|
||||||
|
#else
|
||||||
|
#define QLock DQLock
|
||||||
|
#define qlock dqlock
|
||||||
|
#define qunlock dqunlock
|
||||||
|
#define threadexitsall exits
|
||||||
|
#define threadmain main
|
||||||
|
|
||||||
struct QLock
|
typedef struct QLock QLock;
|
||||||
{
|
|
||||||
pthread_mutex_t m;
|
|
||||||
int init;
|
|
||||||
};
|
|
||||||
|
|
||||||
void qlock(QLock*);
|
struct QLock
|
||||||
void qunlock(QLock*);
|
{
|
||||||
|
int init;
|
||||||
|
pthread_mutex_t m;
|
||||||
|
};
|
||||||
|
|
||||||
|
void qlock(QLock*);
|
||||||
|
void qunlock(QLock*);
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue