#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 thread15;

#if _RTL_POSIX_MUTEXS 
extern pthread_mutex_t mutex;
#endif

extern unsigned long mprot_prueba;

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






#endif
