https://github.com/root-project/root
Revision a5494997cc0ade061acd5c7050328bd442c073ec authored by Rene Brun on 18 July 2003, 15:36:38 UTC, committed by Rene Brun on 18 July 2003, 15:36:38 UTC
The text size in PostScript files is now computed in order to fit exactly
with the TTF text size on screen. Previously it was close but a bit
different, therefore on long character strings it was possible to see gaps
between various pieces of a TLatex expression.


git-svn-id: http://root.cern.ch/svn/root/trunk@6973 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent 6d814d7
Raw File
Tip revision: a5494997cc0ade061acd5c7050328bd442c073ec authored by Rene Brun on 18 July 2003, 15:36:38 UTC
From Olivier,
Tip revision: a549499
threads.C
//example of a simple script creating 3 threads
//this script can only be executed via ACLIC .x threads.C+
//before executing the script, load the Thread library with
//  gSystem->Load("libThread");
   
#include "TThread.h"
#include <Riostream.h>

void* handle(void* ptr) {
  int nr = (int) ptr;

  for (Int_t i=0;i<10;i++) {
    TThread::Lock();
    printf("Here I am loop index: %3d , thread: %d\n",i,nr);
    TThread::UnLock();
    sleep(1);
  }
  return 0;
}

void threads() {
  gDebug = 1;

  printf("Starting Thread 1\n");
  TThread *h1 = new TThread("h1", handle, (void*) 1);
  h1->Run();
  printf("Starting Thread 2\n");
  TThread *h2 = new TThread("h2", handle, (void*) 2);
  h2->Run();
  printf("Starting Thread 3\n");
  TThread *h3 = new TThread("h3", handle, (void*) 3);
  h3->Run();
}
back to top