Code:
- Mtx.lock ();
- printf ("node%d push localw Prepared,and local flag=%d, Clock=%d\n ", Procid,localw.getflag (), Localw.getclock ());
- printf ("Localq is empty:%s\n", Localq.empty ()? " True ":" false ");
- Localq.push (LOCALW);
- printf ("node%d push localw Successfully,and front flag= %d,clock:%d\n ", Procid,localq.front (). Getflag (), Localq.front (). Getclock ());
- printf ("node%d push localw Successfully,and local flag= %d,clock:%d\n ", Procid,localw.getflag (), Localw.getclock ());
- Mtx.unlock ();
The result of the output is magical, for everyone to look at:
Node 2 push localw Prepared,and local flag=0,clock=0
Localq is Empty:true
Node 2 push LOCALW Successfully,and front flag=4,clock:24
Node 2 push localw Successfully,and local flag=0,clock:0
There is no reason to find out why I will update it.
A section of the metaphysical code in the C + + queues queue