changeset 8:9ee04de7718a

add gradle file
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 23 Sep 2016 11:59:50 +0900
parents f81f6dfc0cc5
children e6ea4e10df98
files build.gradle src/deadLockTest/TestDeadLock.java src/threadTest/Client.java src/threadTest/Server.java
diffstat 4 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.gradle	Fri Sep 23 11:59:50 2016 +0900
@@ -0,0 +1,22 @@
+group 'kono'
+version '1.0-SNAPSHOT'
+
+apply plugin: 'java'
+
+sourceCompatibility = 1.8
+
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    testCompile group: 'junit', name: 'junit', version: '4.11'
+}
+
+jar {
+        // from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
+        manifest {
+            attributes  "Main-Class": "deadLockTest.TestDeadLock"
+            attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
+        }
+}
--- a/src/deadLockTest/TestDeadLock.java	Tue Dec 11 16:40:31 2012 +0900
+++ b/src/deadLockTest/TestDeadLock.java	Fri Sep 23 11:59:50 2016 +0900
@@ -4,7 +4,7 @@
 	Server hotel = new Server("Hilton");
 	Server plane = new Server("JAL");
 	Client t2 = new Client("Steve", plane,hotel);
-	Client t3 = new Client("Tedd", hotel,plane);
+	Client t3 = new Client("Tedd", plane,hotel);
 	
 	public static void main(String arg[]) throws InterruptedException  {
 		TestDeadLock test = new TestDeadLock();
--- a/src/threadTest/Client.java	Tue Dec 11 16:40:31 2012 +0900
+++ b/src/threadTest/Client.java	Fri Sep 23 11:59:50 2016 +0900
@@ -8,6 +8,6 @@
 	}
 	
 	public void run() {
-	    server.slow_work();
+	    server.work();
 	}
 }
--- a/src/threadTest/Server.java	Tue Dec 11 16:40:31 2012 +0900
+++ b/src/threadTest/Server.java	Fri Sep 23 11:59:50 2016 +0900
@@ -12,10 +12,10 @@
 	void slow_work()  {
 		int tmp;
 		tmp = count ;
-		//sloop();
+		sloop();
 		//System.err.println("server-enter: count="+count);
 		tmp ++;
-		//sloop();
+		sloop();
 		count = tmp ;
 		//System.err.println("server-leave: count="+count);
 	}