WriteProgramThere is a strange phenomenon in a data processing module. There is a variable in it that is a writable list, which is modified with protected. Data is appended in the thread, and then processed data is retrieved externally, check whether data has been read before. The structure is as follows:
// The global variable stores the data protected into list <bitmap> outer_q = new into list <bitmap> (); run {While (true ){... // generate bitmapouter_q.add (Bitmap); system. out. println ("Run () ----> outer_q.size =" + outer_q.size () ;}} public Boolean isgetdata () {system. out. println ("isgetdata () ----> outer_q.size =" + outer_q.size (); Return outer_q.size () = 0? False: true ;}
Then the strange phenomenon occurs. After each add operation, the calculation size is increased every time. When isgetdata () is used to calculate the size, 0 is returned for both life and death, which is strange. Somehow, the logical relationship is handled n times and thoroughly checked. There is no place to remove the content of the linked list. It's a strange thing. Nima was finally defined to add the static keyword to modify and erase it. The whole world is bright. Nima, this road kill cannot afford to hurt java. It is such a tragedy if the foundation is not good, I have to make up for it... Why... Who gave analysis and why ???
Protected static comment list <bitmap> m_out_q = new comment list <bitmap> ();