home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 5
/
FreshFish_July-August1994.bin
/
bbs
/
gnu
/
aplusplus-1.01-src.lha
/
src
/
amiga
/
aplusplus-1.01
/
amiproc
/
test.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-14
|
844b
|
33 lines
#include "amiproc.h"
#include <stdio.h>
/* Declare some __near external data. This is reallocated for */
/* each new subprocess, so all processes have their own private */
/* copy. When the copy is first made, it will have the value */
/* it's being set to here, even if the parent has changed it. */
char *ext = "This is the original value of ext";
int subprocess(void *arg)
{
printf("%s: ext = \"%s\"\n\n", arg, ext);
return 0;
}
void main(void)
{
struct AmiProcMsg *first, *second;
first = AmiProc_Start(subprocess, "First subprocess");
subprocess("Original process, before resetting externs");
ext = "This is the new value of ext";
second = AmiProc_Start(subprocess, "Second subprocess");
subprocess("Original process, after resetting externs");
AmiProc_Wait(first);
AmiProc_Wait(second);
}