{"action":"created","issue":{"url":"https://api.github.com/repos/concurrent-programming-in-scala/learning-examples/issues/26","labels_url":"https://api.github.com/repos/concurrent-programming-in-scala/learning-examples/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/concurrent-programming-in-scala/learning-examples/issues/26/comments","events_url":"https://api.github.com/repos/concurrent-programming-in-scala/learning-examples/issues/26/events","html_url":"https://github.com/concurrent-programming-in-scala/learning-examples/issues/26","id":130290773,"number":26,"title":"Is the CAS implemention demo wrong?","user":{"login":"amoszhou","id":4480060,"avatar_url":"https://avatars.githubusercontent.com/u/4480060?v=3","gravatar_id":"","url":"https://api.github.com/users/amoszhou","html_url":"https://github.com/amoszhou","followers_url":"https://api.github.com/users/amoszhou/followers","following_url":"https://api.github.com/users/amoszhou/following{/other_user}","gists_url":"https://api.github.com/users/amoszhou/gists{/gist_id}","starred_url":"https://api.github.com/users/amoszhou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amoszhou/subscriptions","organizations_url":"https://api.github.com/users/amoszhou/orgs","repos_url":"https://api.github.com/users/amoszhou/repos","events_url":"https://api.github.com/users/amoszhou/events{/privacy}","received_events_url":"https://api.github.com/users/amoszhou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-01T08:22:18Z","updated_at":"2016-02-01T09:59:29Z","closed_at":"2016-02-01T09:59:29Z","body":"in the page 113 of the book:\r\ndef compareAndSet(ov: Long, nv: Long): Boolean=\r\nthis.synchronized {\r\nif (this.get == ov) false else {\r\nthis.set(nv)\r\ntrue\r\n}\r\n}\r\n\r\nIs the result of condition  wrong ?  \r\n`if (this.get == ov) this.set(nv)\r\ntrue \r\nelse {\r\nfalse\r\n}`\r\n\r\n?\r\n"},"comment":{"url":"https://api.github.com/repos/concurrent-programming-in-scala/learning-examples/issues/comments/177885509","html_url":"https://github.com/concurrent-programming-in-scala/learning-examples/issues/26#issuecomment-177885509","issue_url":"https://api.github.com/repos/concurrent-programming-in-scala/learning-examples/issues/26","id":177885509,"user":{"login":"axel22","id":151774,"avatar_url":"https://avatars.githubusercontent.com/u/151774?v=3","gravatar_id":"","url":"https://api.github.com/users/axel22","html_url":"https://github.com/axel22","followers_url":"https://api.github.com/users/axel22/followers","following_url":"https://api.github.com/users/axel22/following{/other_user}","gists_url":"https://api.github.com/users/axel22/gists{/gist_id}","starred_url":"https://api.github.com/users/axel22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axel22/subscriptions","organizations_url":"https://api.github.com/users/axel22/orgs","repos_url":"https://api.github.com/users/axel22/repos","events_url":"https://api.github.com/users/axel22/events{/privacy}","received_events_url":"https://api.github.com/users/axel22/received_events","type":"User","site_admin":false},"created_at":"2016-02-01T09:59:29Z","updated_at":"2016-02-01T09:59:29Z","body":"Yes - that's been reported, and the correction is in the book errata:\r\n\r\nhttp://concurrent-programming-in-scala.github.io/pages/errata.html\r\n\r\nThanks for bringing this up!"}}