摘要: <RadioGroup android:id="@+id/tab_rg_group" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <RadioButton android:id="@+id/textView2" style="@style/TextView_AllOrders" android:l 阅读全文
posted @ 2012-09-23 20:46 sfshine 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 记下来,很重要。Java语言的关键字,当它用来修饰一个方法或者一个代码块的时候,能够保证在同一时刻最多只有一个线程执行该段代码。 一、当两个并发线程访问同一个对象object中的这个synchronized(this)同步代码块时,一个时间内只能有一个线程得到执行。另一个线程必须等待当前线程执行完这个代码块以后才能执行该代码块。 二、然而,当一个线程访问object的一个synchronized(this)同步代码块时,另一个线程仍然可以访问该object中的非synchronized(this)同步代码块。 三、尤其关键的是,当一个线程访问object的一个synchronized(this 阅读全文
posted @ 2012-09-23 20:45 sfshine 阅读(99) 评论(0) 推荐(0) 编辑