1. Georg Brandl
  2. pygments-main
  3. Issues
Issue #744 new

guess_lexer returns pygments.lexers.MatlabLexer instead of C# parser

Ziang Song
created an issue
package com.work;

class Resource{
     int Goods=0;
     boolean choose=false;
}
class Consumer implements Runnable{  //
    Resource r;
    public Consumer(Resource r){
        this.r=r;
    }
    public void run() {
       synchronized (r) {
        while (true) {
            if (r.choose==true) {
                r.Goods--;
                r.choose=false;
                System.out.println(""+r.Goods);
            }
         }
      }        
    }
  }
class Producer implements Runnable{  //
    Resource r;
    public Producer(Resource r){
        this.r=r;
    }
    public void run() {
         synchronized (r) {
            while (true) {
                if (r.choose==false) {
                    r.Goods++;  //1
                    r.choose=true;
                    System.out.println(""+r.Goods);
                }
            }    
          }        
        }
       }

public class Sample {

    public static void main(String[] args) {
       Resource r=new Resource();
       Consumer con=new Consumer(r);
       Producer pro=new Producer(r);
       Thread b=new Thread(pro);
       b.start();
       Thread a=new Thread(con);
       a.start();
     }
}

Comments (2)

  1. Log in to comment