Télécharger oooddl.eso

Retour à la liste

Numérotation des lignes :

oooddl
  1. C OOODDL SOURCE PV090527 26/04/24 08:23:02 12524
  2. subroutine oooddl(pseg,harg)
  3. C
  4. C verifier qu'on n'est pas en deadlock. Sinon erreur
  5. C
  6. -INC IOODES
  7. -INC IOOADR
  8. -INC IOOWCOM
  9. -INC IOOUNIT
  10.  
  11. character*(*) harg
  12. character*(80) ooo_ha(128)
  13. INTEGER ooo_wa(128),ooo_w2(128),ooo_ka(128),ooo_nbthr,pseg
  14. SAVE ooo_wa ,ooo_w2 ,ooo_ka ,ooo_nbthr,ooo_ha
  15.  
  16. C On met un SEGMENT pour avoir OOTHRD (le traducteur s'en charge)
  17. SEGMENT ISEG(0)
  18.  
  19. nth=oothrd
  20. ooo_w2(nth+1)=pseg
  21. ooo_wa(nth+1)=pseg
  22. ooo_ha(nth+1)=harg
  23. ooo_ka(nth+1)=KASINS
  24.  
  25. do 100 jth=0,ooo_nbthr-1
  26. if (ooo_wa(jth+1).eq.0) return
  27. 100 continue
  28.  
  29. do 220 ith=0,ooo_nbthr-1
  30. iseg=ooo_wa(ith+1)
  31. hdia=ooo_ha(ith+1)
  32. ldia=len(hdia)
  33. KASINS=ooo_ka(ith+1)
  34. write (ooo_ha(ith+1),'('' rw: '',i6,'' ro: '',2i6,
  35. & '' ASSISTANT '',i3)')
  36. & mdrw(iseg),mdro1(iseg),mdro2(iseg),ith
  37. call oooerr (iseg,2,'DEADLOCK DETECTEE '//ooo_ha(ith+1))
  38. 220 continue
  39. stop
  40.  
  41. C on note qu'on n'est plus en attente
  42. entry oooudl
  43. nth=oothrd
  44. C iseg=ooo_wa(nth+1)
  45. ooo_wa(nth+1)=0
  46. ooo_w2(nth+1)=0
  47. return
  48.  
  49. C initialisations au demarrage
  50. entry oooidl
  51. C write (JLST,*) ' oooidl appele'
  52. do 300 ith=0,127
  53. ooo_wa(ith+1)=0
  54. ooo_w2(ith+1)=0
  55. ooo_ha(ith+1)=' '
  56. 300 continue
  57. ooo_nbthr=1
  58. return
  59.  
  60. C test si ce segment est en attente
  61. entry oootdl(pseg,ifla)
  62. do jth=0,ooo_nbthr-1
  63. if (ooo_w2(jth+1).eq.pseg) goto 170
  64. enddo
  65. ifla=0
  66. return
  67. 170 continue
  68. ifla=1
  69. return
  70.  
  71. C sur un segdes, on signal le wait parti. Si le thread est bloque en attente du global mutex, il ne le fera pas lui meme
  72. entry ooosdl(pseg)
  73. do 400 ith=0,ooo_nbthr-1
  74. if (ooo_wa(ith+1).eq.pseg) ooo_wa(ith+1)=0
  75. 400 continue
  76. return
  77.  
  78. C nombre de thread
  79. entry ooondl(nthr)
  80. ooo_nbthr=nthr+1
  81. end
  82.  
  83.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales