#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "SEAL_Thread.h"
#include "SEAL_Lock.h"
#include "SEAL_Util.h"

double buffer1;
double buffer2;
Lock outbufferLock;
Thread Thread1;
Thread Thread2;
void *Thread1___Func (void *arg)
{
while (1)
{sleep(1);
SEALLock_Acquire(&outbufferLock);
buffer1 = 2.4;
buffer2 = 4.5;
printf("Current throttle rate is %f degrees/sec, and current acceleration is %f knots/sec\n", buffer1, buffer2);
SEALLock_Release(&outbufferLock);
}
}

void *Thread2___Func (void *arg)
{
while (1)
{sleep(1);
SEALLock_Acquire(&outbufferLock);
buffer1 = 113.45;
buffer2 = 5.1;
printf("Current from servomotor is now %fmA, and voltage is now %fV\n", buffer1, buffer2);
SEALLock_Release(&outbufferLock);
}
}

void  main()
{
int a;
int b;
int c;
c = (b + a);

printf("The value of c=%d b=%d and a=%d\n", c, b, a);

}

