flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #5645: FLINK-8876 Improve concurrent access handling in s...
Date Tue, 06 Mar 2018 13:13:55 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5645#discussion_r172510349
  
    --- Diff: flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSerializer.java
---
    @@ -277,6 +349,26 @@ private void initializeAvro() {
     		this.decoder = new DataInputDecoder();
     	}
     
    +	// --------------------------------------------------------------------------------------------
    +	//  Concurrency checks
    +	// --------------------------------------------------------------------------------------------
    +
    +	private void enterExclusiveThread() {
    +		// we use simple get, check, set here, rather than CAS
    +		// we don't need lock-style correctness, this is only a sanity-check and we thus
    +		// favor speed at the cost of some false negatives in this check
    +		Thread previous = currentThread;
    +		if (previous == null) {
    +			currentThread = Thread.currentThread();
    +		} else {
    --- End diff --
    
    same as for kroy


---

Mime
View raw message