Package windows

Source Code of windows.CriticalSectionTest

package windows;

import org.junit.Test;

import windows.kernel32.CRITICAL_SECTION;
import static windows.kernel32.Kernel32.*;
import static org.bridj.Pointer.*;

public class CriticalSectionTest {

  @Test
  public void testCS() {
    try {
      CRITICAL_SECTION cs = new CRITICAL_SECTION();
      InitializeCriticalSection(pointerTo(cs));
      EnterCriticalSection(pointerTo(cs));
      System.out.println(cs.OwningThread().getPeer());
     
      LeaveCriticalSection(pointerTo(cs));
      DeleteCriticalSection(pointerTo(cs));
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}
TOP

Related Classes of windows.CriticalSectionTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.