Alx09

Dispecer

Mar 2nd, 2021
952
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <conio.h>
  4. #include <dos.h>
  5. #include <mem.h>
  6. #include "rtc86.h"
  7.  
  8. TSK_IDENT tsk1,tsk2,tsk3;
  9.  
  10.  
  11. TASK t1(void)
  12. {
  13.  while(1){
  14.     printf("a");
  15.     _sleep(10);
  16.  }
  17. }
  18.  
  19. TASK t2(void)
  20. {
  21.  while(1){
  22.  printf("b");
  23.  _sleep(30);
  24.  }
  25. }
  26.  
  27. TASK t3(void)
  28. {
  29.  while(1){
  30.     printf("c");
  31.     _sleep(50);
  32.  }
  33. }
  34.  
  35.  
  36. void main(void)
  37. {
  38.  
  39.     _install();
  40.  
  41.     _create(tsk1,t1,1,3,tsk1);
  42.     _create(tsk2,t2,1,3,tsk2);
  43.     _create(tsk3,t3,1,3,tsk3);
  44.     _activate(tsk1);
  45.     _activate(tsk2);
  46.     _activate(tsk3);
  47.     _run(300);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment