Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add even messages to file F1
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "shared.h"
- #include "message.h"
- int main(){
- common *msg; int i;
- msg = (common *)getmem(615621961);
- sem_t full = sem_init(615621962);
- sem_t empty = sem_init(615621963);
- FILE *fp = fopen("./F1.txt", "w");
- for(i=1; i<30; i++){
- PS(full);
- if(msg->number%2==0){
- fprintf(fp,"%s", msg->name);
- fprintf(fp,"\n");
- }
- VS(empty);
- } //end i<30
- fclose(fp);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement