#include <time.h>
#include <pthread.h>
#include <rtl_ipc.h>
#include <semaphore.h>
#include <rtl_barrier.h>
#include <rtl_printf.h>
#include <rtl_conf.h>
#include <unistd.h>
#include "examples.h"

#if MPROTIPC_EXAMPLE 

static unsigned long valor5=0x0;
static unsigned long valor6=0x0;


pthread_t thread14;

#if _RTL_POSIX_MUTEXS 
pthread_mutex_t mutex;
#endif

extern unsigned long mprot_prueba;

void *task14(void *arg)
{
  int aux; 
#if _RTL_POSIX_MUTEXS 
  while(1)
  {
    
    pthread_mutex_lock (&mutex);
    for (aux=0;aux<=3;aux++) {
      rtl_printf("Task 14: Valor %d\n",valor5);    
      valor5++;
      usleep(2000000);
    };
    pthread_mutex_unlock (&mutex);
    usleep(1000);
  };
#else
  while(1) {};
#endif
  return 0;
};








#endif
