Skip to content

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

@Anteru

Description

@Anteru

(Original issue 744 created by ziangsong on 2012-03-01T03:52:39.594408+00:00)

#!Java

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();
     }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-majorseverity: majorT-bugtype: a bugX-importedimported from Bitbucket

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions