Skip to content

Instantly share code, notes, and snippets.

@rayjcwu
Created February 28, 2014 23:01
Show Gist options
  • Select an option

  • Save rayjcwu/9281821 to your computer and use it in GitHub Desktop.

Select an option

Save rayjcwu/9281821 to your computer and use it in GitHub Desktop.
class Server {
Map<Stock, StockTx> map = new HashMap<Stock, StockTx>();
public void publish() {
Map<Stock, StockTx> mapBack = null;
synchronized(this) {
mapBack = map;
map = new HashMap<Stock, StockTx>();
}
// following
}
}
class StockTx {
String transactionType;
String price;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment